Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm working with a lot of Toolbars for my buttons. There is a thing that's driving me crazy about them though. I often have the user using 2 forms.

 

Lets say you have Button1 on ToolBar1 which is on Form 1..

Well if you have the focus on another form , such as Form2 and you click the Button1 then you have to click the button 2x for it to register the click. The first click only chooses Form1, and does not click the button. No other control on Form1 has this problem but the Toolbar button1.

 

I'm not sure if this is a 2.0 thing or what, Wordpads toolbar does not seem to have this issue but VS.Net 2005's Interface Toolbar does.

Currently Using: Visual Basic.Net 2005, .Net Framework 2.0
  • Leaders
Posted

The reason you see this behavior in .Net 2.0 is because in .Net 2.0 we generally use the ToolStrip control, the control with this problem. In .Net 1.x we used the ToolBar control, which still does not have this problem in 2.0.

 

I hoped that in this situation perhaps the MouseDown event could be handled, where a hit test could be performed to see which button was clicked so that we could, by calling the PerformClick method of a ToolStripItem, force the click through code. The problem, it seems, is that the ToolStrip does not recieve MouseDown or Click events when the form it's on does not have focus.

[sIGPIC]e[/sIGPIC]
Posted

Ya, i suppose i'll probably not use toolstrips then. This is an unfortunate thing in 2.0

 

The reason you see this behavior in .Net 2.0 is because in .Net 2.0 we generally use the ToolStrip control, the control with this problem. In .Net 1.x we used the ToolBar control, which still does not have this problem in 2.0.

 

I hoped that in this situation perhaps the MouseDown event could be handled, where a hit test could be performed to see which button was clicked so that we could, by calling the PerformClick method of a ToolStripItem, force the click through code. The problem, it seems, is that the ToolStrip does not recieve MouseDown or Click events when the form it's on does not have focus.

Currently Using: Visual Basic.Net 2005, .Net Framework 2.0

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...