NeuralJack Posted September 13, 2006 Posted September 13, 2006 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. Quote Currently Using: Visual Basic.Net 2005, .Net Framework 2.0
Leaders snarfblam Posted September 13, 2006 Leaders Posted September 13, 2006 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. Quote [sIGPIC]e[/sIGPIC]
NeuralJack Posted September 13, 2006 Author Posted September 13, 2006 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. Quote Currently Using: Visual Basic.Net 2005, .Net Framework 2.0
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.