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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dialog box help

Status
Not open for further replies.

namgc2

Programmer
Sep 8, 2007
12
0
0
GB
Hi,

What are constraints in using option buttons in a group box in a dialog box.

I need the user to make a choice between option a or b. The result would be different options presented to the user with each choice. In total the dialog box has 7 group boxes. Three being offered if main option is choice A. Three differnt choices for choice B. I only want to display the appropriate option buttons in the group boxes for the relevant choice using dlgvisible.

Many thanks
 
Hi again,

Does the filedlgfunction only work with a checkbox. I'd like to use 2 optionbuttons within a group but nothing happens?
 
Is this what you're looking for?

Code:
Function dlgMyFunc(identifier$, action, suppvalue)
  Select Case action
  Case 1
    dlgVisible "Group2", 0
    dlgVisible "Group3", 0
  Case 2
  Case 3
  Case 4
    Select Case identifier$
    Case "optA"
      dlgVisible "Group2", 1
      dlgVisible "Group3", 0
    Case "optB"
      dlgVisible "Group2", 0
      dlgVisible "Group3", 1
    End Select
  End Select
End Function

Sub Main
  Begin Dialog dlgJunk 80, 70, "MyDialog", .dlgMyFunc
    ButtonGroup .ButtonPressed
    OkButton 5, 40, 20, 12, .BtnOK
    OptionGroup .Group1
    OptionButton 5, 5, 20, 12, "A", .optA
    OptionButton 30, 5, 20, 12, "B", .optB
    OptionGroup .Group2
    OptionButton 5, 20, 20, 12, "1", .opt2_1
    OptionButton 30, 20, 20, 12, "2", .opt2_2
    OptionButton 55, 20, 20, 12, "3", .opt2_3
    OptionGroup .Group3
    OptionButton 5, 20, 20, 12, "4", .opt3_1
    OptionButton 30, 20, 20, 12, "5", .opt3_2
    OptionButton 55, 20, 20, 12, "6", .opt3_3
  End Dialog

  Dim dlgVar as dlgJunk
  On Error Resume Next
  Dialog dlgVar
End Sub
 
Thanks very much. This is spot on, exactly what I wanted.

Great stuff !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top