streetprog
Technical User
I have a rather extensive dialog box I'm working on that has a number of textboxes, droplistboxes, and checkboxes.
For one of my textboxes, I want to refresh the Dialog Box so that several droplistboxes become visible or invisible based on the input in the textbox. This works fine, but only if the user selects another droplistbox or checks a checkbox (Case 2 in FileDlgFunction). Is there a way that I can use a button to cause the dialog to refresh but keep the data I've already updated? If I click the button now, it just closes out of the dialog.
In my code, I want ".RefreshButton" to have it check for:
I've removed a lot of the code for purposes of brevity the Identifier$ numbers will be off but I've noted what they refer to.
Any help will be greatly appreciated!
For one of my textboxes, I want to refresh the Dialog Box so that several droplistboxes become visible or invisible based on the input in the textbox. This works fine, but only if the user selects another droplistbox or checks a checkbox (Case 2 in FileDlgFunction). Is there a way that I can use a button to cause the dialog to refresh but keep the data I've already updated? If I click the button now, it just closes out of the dialog.
In my code, I want ".RefreshButton" to have it check for:
Code:
If DlgText(86) = "1" then DlgVisible 80, 1 : DlgVisible 81, 0 : DlgVisible 82, 0 : DlgVisible 83, 0 : DlgVisible 84, 0
I've removed a lot of the code for purposes of brevity the Identifier$ numbers will be off but I've noted what they refer to.
Code:
Declare Function FileDlgFunction(identifier$, action, suppvalue)
Function FileDlgFunction(identifier$, action, suppvalue)
Select Case action
Case 1 'dialog started
Case 2 'user changed control or clicked a button
If DlgControlID(identifier$) = 96 then 'this is where the button is clicked, but it doesn't function correctly
If DlgText(86) = "1" then DlgVisible 80, 1 : DlgVisible 81, 0 : DlgVisible 82, 0 : DlgVisible 83, 0 : DlgVisible 84, 0
End If
End Select
End Function
Sub Main()
Dim button as integer
Dim identifier$
Dim action as Integer
Dim suppvalue as Integer
Dim months 'List
months=" "+Chr$(9)+"Jan"+Chr$(9)+"Feb"+Chr$(9)+"Mar"+Chr$(9)+"Apr"+Chr$(9)+"May"+Chr$(9)+"Jun"+Chr$(9)+"Jul"+Chr$(9)+"Aug"+Chr$(9)+"Sep"+Chr$(9)+"Oct"+Chr$(9)+"Nov"+Chr$(9)+"Dec"
Begin Dialog dlgPick 50, 50, 430, 270, "Pick List", .FileDlgFunction
ButtonGroup .ButtonGroup1
Text 10, 175, 70, 10, "Info changes", .Text35
DropListBox 70, 173, 33, 120, months, .DropListBox12 'These are 80-84
DropListBox 105, 173, 33, 120, months, .DropListBox13
DropListBox 140, 173, 33, 120, months, .DropListBox14
DropListBox 175, 173, 33, 120, months, .DropListBox15
DropListBox 210, 173, 33, 120, months, .DropListBox16
Text 10, 160, 70, 10, "# per year", .Text36
Textbox 70, 158, 18, 12, .text#PerYear 'This is 86
Button 245, 174, 11, 10, "*", .RefreshButton 'This is 96
OKButton 270, 243, 50, 12
CancelButton 325, 243, 50, 12
End Dialog
Dim mydialog as dlgPick
nRet = Dialog(mydialog)
select case nRet
case -1
'Click OK and it performs certain actions based on the selections made
case 0
exit sub
end select
End Sub
Any help will be greatly appreciated!