Print Page | Close Window

PushButton visible/invisible --> focus?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=10215
Printed Date: 28 March 2024 at 12:45pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: PushButton visible/invisible --> focus?
Posted By: Jean
Subject: PushButton visible/invisible --> focus?
Date Posted: 14 April 2008 at 2:07am


In this sample there are two buttons. A Microsoft CommandButton and a CodeJock PushButton. This buttons are only visible if item "B" in the ComboBox is selected.
Now try to use this form ONLY BY KEYBOARD. If you change ComboBox 2 with "cursor up" and "cursor down" and the PushButton gets visible, then the focus goes to the button. That doesn't happen with the Microsoft CommandButton.
This behavior is annoying.



Replies:
Posted By: Jean
Date Posted: 14 April 2008 at 2:15am
Sample:  uploads/20080414_021503_BushButtonSampl.zip - uploads/20080414_021503_BushButtonSampl.zip


Posted By: Oleg
Date Posted: 14 April 2008 at 4:16am
Agree. But afraid its internal routines of Visual Basic. our Pushbutton is ActiveX control standard is builtin button.
 
Here workaround:
 
Option Explicit
Private Sub Combo1_Click()
Command1.Visible = Combo1.ListIndex = 1
End Sub
Private Sub Combo2_Click()
If (Combo2.ListIndex = 1) Then
    PushButton1.Left = PushButton1.Left + 7000
    PushButton1.Enabled = True
Else
    If PushButton1.Left > 0 Then PushButton1.Left = PushButton1.Left - 7000
    PushButton1.Enabled = False
End If
End Sub
Private Sub Form_Load()
Combo1.AddItem "A"
Combo1.AddItem "B"
Combo1.AddItem "C"
Combo1.AddItem "D"
Combo1.AddItem "E"
Combo2.AddItem "A"
Combo2.AddItem "B"
Combo2.AddItem "C"
Combo2.AddItem "D"
Combo2.AddItem "E"
Combo2_Click
End Sub


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Jean
Date Posted: 14 April 2008 at 5:18am
Ok, thank you.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net