Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Last button doesn't work

Status
Not open for further replies.

Echilon

Programmer
Feb 22, 2007
54
GB
I'm trying to create several user dialogs. This is my code:

Sub Main

Dim System As Object
Dim Sess As Object
Set System = CreateObject("EXTRA.System")
Set Sess = System.ActiveSession
Begin Dialog UserDialog 136, 39, 108, 89, "Faulty Pair Solution"
ButtonGroup .AllButtons
PushButton 10, 40, 90, 18, "Yes"
PushButton 10, 60, 90, 18, "No"
GroupBox 5, 30, 100, 55, "Is the Engineer Multi-Skilled?"
Text 5, 5, 100, 10, "Report a"
Text 5, 15, 100, 10, "fault"
End Dialog


Dim optsdialog as UserDialog
ichoice = Dialog(optsdialog)

Select Case ichoice
Case 0
Sess.Screen.SendKeys("Multi-skilled<Tab>Y<Tab>")
Case 1
Sess.Screen.SendKeys("Not multi-skilled<Tab>Y<Tab>")
End Select
End Sub

However, the second button doesn't work. I've spent the whole day coding several similar dialogs, and the last button on every one doesn't work. Some of them have six or seven choices, but it's always the last button which is dead.

Any ideas why?
 
Start your case with 1 instead of 0.

Sub Main

Dim System As Object
Dim Sess As Object
Set System = CreateObject("EXTRA.System")
Set Sess = System.ActiveSession
Begin Dialog UserDialog 136, 39, 108, 89, "Faulty Pair Solution"
ButtonGroup .AllButtons
PushButton 10, 40, 90, 18, "Yes"
PushButton 10, 60, 90, 18, "No"
GroupBox 5, 30, 100, 55, "Is the Engineer Multi-Skilled?"
Text 5, 5, 100, 10, "Report a"
Text 5, 15, 100, 10, "fault"
End Dialog


Dim optsdialog as UserDialog
msgbox Dialog(optsdialog)
End Sub

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top