
Glad it worked!

Scott
------------------
Scott
mailto:[email protected][email protected]</A>
'In Winmain Control Add ComboBox, g_hDlgMisc(lLoop), %IDCOMBOBOX,serv(), 60, 30, 160, _ 120,%CBS_DROPDOWNLIST Or %WS_VSCROLL Or %WS_TABSTOP 'In the dialog callback, user selects which time server to use: Case %IDCOMBOBOX EnableButtons If LoWrd(CbCtlMsg) = %CBN_SELENDOK Then ComboBox Get Text g_hDlgMisc(1),%IDCOMBOBOX To nServer ServerNum = GetServerNum(nServer) ComboBox Select g_hDlgMisc(ServerNum), %IDCOMBOBOX,ServerNum End If Function = 1 Exit Function ;And then the function Function GetServerNum(nServer As String) As Long Local x As Long For x = 1 To %MAX_SERVERS If nServer = Serv(x)Then Function = x Exit For End If Next End Function I'm not sure if this is related or not, and you may have to reverse it...but basically you can either get text or get the ID of the selection and then match a string to that (??) Maybe i'm way off base here, but if this helps...
#Compile Exe #Register None #Dim All #Include "win32api.inc" Global perc As Double Global s As String Global hDlg As Long CallBack Function DlgProc Select Case CbMsg Case %WM_COMMAND Select Case CbCtl Case %IDOK: Dialog End CbHndl, 1 Case %IDCANCEL: Dialog End CbHndl, 0 Case 101 To 108 If CbCtlMsg = %BN_CLICKED Then If CbCtl = 101 Then perc# = .05# If CbCtl = 102 Then perc# = .10# If CbCtl = 103 Then perc# = .125# If CbCtl = 104 Then perc# = .15# If CbCtl = 105 Then perc# = .175# If CbCtl = 106 Then perc# = .20# If CbCtl = 107 Then perc# = .25# If CbCtl = 108 Then perc# = .30# End If Case 301 Select Case CbCtlMsg Case %CBN_SELENDOK Dim txt As String ComboBox Get Text CbHndl, 301 To s$ End Select End Select End Select End Function Function PbMain ' ** Create a new dialog template Dialog New %HWND_DESKTOP, "LOG SPIRAL", 0, 0, 367, 250,%WS_CAPTION _ Or %WS_SYSMENU Or %WS_MINIMIZEBOX Or %DS_CENTER, 0 To hDlg ' ** Add controls to it Control Add Button, hDlg, %IDOK, "OK", 300, 185, 40, 14, %BS_DEFAULT Control Add Button, hDlg, %IDCANCEL, "Cancel", 300, 210, 40, 14, 0 Control Add Frame,hDlg,-1,"choose a percent",30,50,70,175, _ %WS_CHILD Or %WS_VISIBLE Or %BS_GROUPBOX Or %WS_EX_TRANSPARENT Control Add Option,hDlg,101,"5%",40,65,53,12 Control Add Option,hDlg,102,"10%",40,85,53,12 Control Add Option,hDlg,103,"12.5%",40,105,53,12 Control Add Option,hDlg,104,"15%",40,125,53,12 Control Add Option,hDlg,105,"17.5%",40,145,53,12 Control Add Option,hDlg,106,"20%",40,165,53,12 Control Add Option,hDlg,107,"25%",40,185,53,12 Control Add Option,hDlg,108,"30%",40,205,53,12 Dim B(1:6) As String b$(1) = "Ivan" b$(2) = "Petr" b$(3) = "Oleg" b$(4) = "Vasia" b$(5) = "Masha" b$(6) = "Lena" Control Add ComboBox, hDlg,301,B$(), 200, 52, 50, 100, %CBS_DROPDOWNLIST Or %CBS_SORT ' ** Display the dialog Dim Result As Long Dialog Show Modal hDlg Call DlgProc To Result If Result = 1 Then MsgBox Format$(perc#)+ " " + s$ Else MsgBox "Canceled" End Function
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: