On Sun, Jun 8, 2008 at 11:41 AM, Xiaofan Chen wrote: > On Sun, Jun 8, 2008 at 3:17 AM, Ruben J=F6nsson wrote: >> I turns out that the application and its controls are behaving with its = default >> behavior. When the button is disabled (.Enable=3Dfalse) and it also has = focus, >> the focus goes to the next control in the tabindex order (just like you = would >> have pressed the tab key on the keyboard). In this case it is either the >> textbox or another button. In the textbox case the default behavior is a= lso to >> select all text in it (highlights it) and for the button it is to set it= as the >> default control (so pressing space activates it). In our case we don't w= ant >> this behavior but there is another even easier solution to fix it than w= hat I >> first gave you: Simply set the focus to another control that doesn't cha= nge >> when it has focus before the button is disabled. In this case there are = the two >> group box controls (fraBulkTransfer and fraInterruptTransfer) that are i= deal >> for this. So just forget what I have said before and do like this instea= d :-) >> > > Thanks a lot. This makes perfect sense and the fix is more elegant. > >From here I actually found out that similar problem exists in Jan Axelson's generic HID host program as well. Your solution works perfectly there as well. I've tested that program for so many times and today is the first time I noticed this bug. Thread about the Generic HID example: http://forum.microchip.com/tm.aspx?m=3D337034 Thread about the WinUSB example: http://forum.microchip.com/tm.aspx?m=3D339511 Xiaofan -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist