Click here to Skip to main content
15,920,632 members
Home / Discussions / C#
   

C#

 
GeneralRe: HID USB - Mag Card Reader Interaction Pin
nitesh11526-Dec-03 8:51
nitesh11526-Dec-03 8:51 
GeneralRe: HID USB - Mag Card Reader Interaction Pin
Kentamanos26-Dec-03 8:53
Kentamanos26-Dec-03 8:53 
GeneralRe: HID USB - Mag Card Reader Interaction Pin
Heath Stewart27-Dec-03 4:47
protectorHeath Stewart27-Dec-03 4:47 
GeneralTreeview Pin
mhmoud rawas24-Dec-03 1:05
mhmoud rawas24-Dec-03 1:05 
GeneralRe: Treeview Pin
Heath Stewart27-Dec-03 4:43
protectorHeath Stewart27-Dec-03 4:43 
GeneralRe: Treeview Pin
Heath Stewart27-Dec-03 5:34
protectorHeath Stewart27-Dec-03 5:34 
GeneralRe: Treeview Pin
mhmoud rawas27-Dec-03 18:09
mhmoud rawas27-Dec-03 18:09 
GeneralRe: Treeview Pin
Heath Stewart28-Dec-03 3:16
protectorHeath Stewart28-Dec-03 3:16 
For one, I did not say you should override the OnPaint method (always override the OnEventName methods when deriving instead of handling the events in your derivitive class, but be sure to call base.OnEventName at the proper time). Because the WM_PAINT message works a little differently for the TreeView (and for the ListView too, for that matter), overriding OnPaint won't completely work. It is used to notify the TreeView that different elements need painting.

Also, if you really must change the default behavior of the tree (and you really shouldn't - keeping a consistent interface across the window manager, the majority of applications, and your own application is important for user friendliness), you could override the OnMouseDown method, check to see which mouse button is down, then see if there's a TreeNode under the cursor, setting it as the selected node:
protected override void OnMouseDown(MouseEventArgs e)
{
  if (e.Button == MouseButtons.Right)
  {
    TreeNode node = this.myTreeView.GetNodeAt(e.X, e.Y);
    if (node != null)
      this.myTreeView.SelectedNode = node;
  }
}


 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralDataAdapter.Fill progress Pin
Alex Korchemniy23-Dec-03 18:30
Alex Korchemniy23-Dec-03 18:30 
GeneralRe: DataAdapter.Fill progress Pin
mhmoud rawas24-Dec-03 1:08
mhmoud rawas24-Dec-03 1:08 
GeneralRe: DataAdapter.Fill progress Pin
SimonS24-Dec-03 8:26
SimonS24-Dec-03 8:26 
GeneralRe: DataAdapter.Fill progress Pin
mhmoud rawas26-Dec-03 19:04
mhmoud rawas26-Dec-03 19:04 
GeneralRe: DataAdapter.Fill progress Pin
SimonS26-Dec-03 21:13
SimonS26-Dec-03 21:13 
GeneralRe: DataAdapter.Fill progress Pin
mhmoud rawas26-Dec-03 21:19
mhmoud rawas26-Dec-03 21:19 
GeneralRe: DataAdapter.Fill progress Pin
Heath Stewart27-Dec-03 4:41
protectorHeath Stewart27-Dec-03 4:41 
GeneralWhy use String.Empty() rather than "" Pin
Marc Clifton23-Dec-03 13:45
mvaMarc Clifton23-Dec-03 13:45 
GeneralRe: Why use String.Empty() rather than "" Pin
Nick Parker23-Dec-03 13:54
protectorNick Parker23-Dec-03 13:54 
GeneralRe: Why use String.Empty() rather than "" Pin
Robert Slaney23-Dec-03 14:36
Robert Slaney23-Dec-03 14:36 
GeneralRe: Why use String.Empty() rather than "" Pin
Nick Parker23-Dec-03 14:51
protectorNick Parker23-Dec-03 14:51 
GeneralRe: Why use String.Empty() rather than "" Pin
Nick Seng23-Dec-03 14:47
Nick Seng23-Dec-03 14:47 
GeneralRe: Why use String.Empty() rather than "" Pin
Bo Hunter23-Dec-03 17:23
Bo Hunter23-Dec-03 17:23 
GeneralRe: Why use String.Empty() rather than "" Pin
Cristoff24-Dec-03 10:17
Cristoff24-Dec-03 10:17 
GeneralRe: Why use String.Empty() rather than "" Pin
Nick Parker24-Dec-03 11:20
protectorNick Parker24-Dec-03 11:20 
GeneralRe: Why use String.Empty() rather than "" Pin
leppie24-Dec-03 13:05
leppie24-Dec-03 13:05 
GeneralRe: Why use String.Empty() rather than "" Pin
Nick Parker28-Dec-03 11:17
protectorNick Parker28-Dec-03 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.