Click here to Skip to main content
15,887,822 members
Home / Discussions / C#
   

C#

 
GeneralRe: Application File Path Pin
mav.northwind10-Oct-05 7:25
mav.northwind10-Oct-05 7:25 
QuestionHow do i change theimage quality of background images? Pin
Red_Wizard_Shot_The_Food9-Oct-05 2:44
Red_Wizard_Shot_The_Food9-Oct-05 2:44 
AnswerRe: How do i change theimage quality of background images? Pin
Christian Graus9-Oct-05 2:46
protectorChristian Graus9-Oct-05 2:46 
Questionstatus bar Pin
Saurabh Walia9-Oct-05 1:16
Saurabh Walia9-Oct-05 1:16 
AnswerRe: status bar Pin
Guffa9-Oct-05 2:12
Guffa9-Oct-05 2:12 
AnswerRe: status bar Pin
David Stone9-Oct-05 3:22
sitebuilderDavid Stone9-Oct-05 3:22 
QuestionPropertyGrid scrolls to selected property Pin
biggz_daddy8-Oct-05 17:20
biggz_daddy8-Oct-05 17:20 
AnswerRe: PropertyGrid scrolls to selected property Pin
joegood10-Oct-05 6:21
joegood10-Oct-05 6:21 
Just in case someone else encounters this problem, here is my current solution:

1) Extend the PropertyGrid class.

/// <summary><br />
  /// This internal PropertyGrid allows us to set the position of<br />
  /// the VScrollBar.<br />
  /// </summary><br />
  internal class HookPropertyGrid : PropertyGrid<br />
  {<br />
    /// <summary><br />
    /// The vertical scroll bar of the PropertyGrid.<br />
    /// Please do a null check before accessing.  There are<br />
    /// times when the VScrollBar will not exist.<br />
    /// </summary><br />
    public VScrollBar VScrollBar<br />
    {<br />
      get<br />
      {<br />
        object view = Controls[1];<br />
        string className = "System.Windows.Forms.VScrollBar";<br />
        return (VScrollBar)PluginGuiUtil.GetFirstControlOfType((Control)view, className);        <br />
      }      <br />
    }<br />
<br />
    /// <summary><br />
    /// Get the vertical scroll bar position<br />
    /// </summary><br />
    /// <returns></returns><br />
    public int GetVScrollPos()<br />
    {<br />
      if (null != VScrollBar)<br />
      {<br />
        return VScrollBar.Value;<br />
      }<br />
      return 0;<br />
    }<br />
<br />
    /// <summary><br />
    /// Set the vertical scroll bar position<br />
    /// </summary><br />
    public void SetVScrollPos(int pos_)<br />
    {<br />
      if (null != VScrollBar)<br />
      {<br />
        VScrollBar.Value = pos_;<br />
      }<br />
    }<br />
  }//end of internal class


2) Before you set the selected object of the PropertyGrid, save off the current scroll pos. After setting the selected object, restore the previous scroll position.

//save off the scroll position<br />
      int pos = m_propertyGrid.GetVScrollPos();<br />
<br />
      //create a property table<br />
      PropertyTable props = new PropertyTable();<br />
<br />
      //create placeholders for all of the known properties<br />
      CreateKnownProps(props);<br />
<br />
      //populate all of the known properties with the entity's data<br />
      PopulateKnownProps(props, e_);<br />
<br />
      //create an populate all of the remaining "other" properties<br />
      CreateAndPopulateUnknownProps(props, e_);<br />
<br />
      //show the property table in the property grid<br />
      m_propertyGrid.SelectedObject = props;<br />
<br />
      //set the vertical scroll bar position to its' previous value<br />
      m_propertyGrid.SetVScrollPos(pos);



The only problem I have seen with this solution is that a selection rectangle will be drawn at the wrong location initially. As soon as you move the scroll bar the selection jumps back to the correct item. This problem only occurs if the selected item is off screen.
QuestionFinding the volume level of the currently recording audio? Pin
karl6438-Oct-05 17:16
karl6438-Oct-05 17:16 
QuestionAccessing property values using GetValue() Pin
mossu8-Oct-05 16:35
mossu8-Oct-05 16:35 
AnswerRe: Accessing property values using GetValue() Pin
Guffa9-Oct-05 0:22
Guffa9-Oct-05 0:22 
GeneralRe: Accessing property values using GetValue() Pin
mossu9-Oct-05 2:38
mossu9-Oct-05 2:38 
GeneralRe: Accessing property values using GetValue() Pin
Guffa9-Oct-05 8:50
Guffa9-Oct-05 8:50 
GeneralRe: Accessing property values using GetValue() Pin
mossu10-Oct-05 3:01
mossu10-Oct-05 3:01 
AnswerRe: Accessing property values using GetValue() Pin
S. Senthil Kumar9-Oct-05 3:18
S. Senthil Kumar9-Oct-05 3:18 
GeneralRe: Accessing property values using GetValue() Pin
mossu9-Oct-05 6:05
mossu9-Oct-05 6:05 
QuestionOODBMS are the best solution for Today applications Pin
tolgayikilmaz8-Oct-05 12:16
tolgayikilmaz8-Oct-05 12:16 
AnswerRe: OODBMS are the best solution for Today applications Pin
johhnny8-Oct-05 12:20
johhnny8-Oct-05 12:20 
AnswerRe: OODBMS are the best solution for Today applications Pin
Colin Angus Mackay8-Oct-05 22:26
Colin Angus Mackay8-Oct-05 22:26 
GeneralRe: OODBMS are the best solution for Today applications Pin
tolgayikilmaz9-Oct-05 1:45
tolgayikilmaz9-Oct-05 1:45 
GeneralRe: OODBMS are the best solution for Today applications Pin
Colin Angus Mackay9-Oct-05 1:48
Colin Angus Mackay9-Oct-05 1:48 
AnswerRe: OODBMS are the best solution for Today applications Pin
Kevin McFarlane9-Oct-05 8:29
Kevin McFarlane9-Oct-05 8:29 
QuestionOpening the Form in maximized mode? Pin
E6AD8-Oct-05 12:09
E6AD8-Oct-05 12:09 
AnswerRe: Opening the Form in maximized mode? Pin
S. Senthil Kumar8-Oct-05 20:03
S. Senthil Kumar8-Oct-05 20:03 
QuestionWindowScraping Pin
budidharma8-Oct-05 11:17
budidharma8-Oct-05 11:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.