Skip to main content

Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba

Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba

Hi ,
not sure if fully understand what you are trying to achieve.
Can share a code snippet and explain your problem a bit more in detail ?
In Rumba Script you can use the Dialog Class. (Start the Script Editor, click Assist . Under Command Class select : Dialog)
The Assistant shows available commands and code samples.


Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba

I Want :
1) Display a message variable in Dialog Box : OK I found
2) Display the name of Dialog Box with variable text (cf printscreen). I don't use Class Dialog (DlgStart...) because impossible to position controls. I use Begin Dialog Dlg1 60 , 70 , 230 , 180, "Test", .DlgFonction. But i want replace "Test" by a text variable same it's possible with DlgTitle in DlgStart.

 

Ps : I use RUMBA 7.30 SP0 Correctif0 and i can't upgrade.


Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba
Hi Patrick,

Unfortunately, there appears to be an issue using a variable name for the dialog title$

Executing the following sub main demos the issue. Basically the variable HelloMsg is not enumerated on the Begin Dialog statement, the title text is populated with the variable name less if first character.

Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
Declare Function GetForegroundWindow Lib "user32" () As Long
Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long

Global HelloMsg as String

Sub Main
HelloMsg = "I was here"

Begin Dialog myDialog 1 , 1 , 186 , 92 , HelloMsg, .MainDialogProc
OkButton 130, 6, 50, 14, .OkButton
CancelButton 130, 23, 50, 14, .CancelButton
End Dialog

Dim MyDlg as myDialog
RetC = Dialog(MyDlg)
End Sub

Function MainDialogProc(id$, action%, suppvalue&)

Dim hWnd As Long, x As Long, ForegroundSessionName As String

Select Case action%
Case 1 'Initialize dialog controls
'Return to main dialog
MainDialogProc = TRUE

Case 2 'One of the buttons or checkboxes was pressed

Select Case id$

Case "OkButton"
'Return to main dialog
MainDialogProc = TRUE
MsgBox "You pressed OK"

Case "CancelButton"
MainDialogProc = FALSE
MsgBox "You pressed Cancel"

Case Else
MainDialogProc = FALSE
End Select

Case 3 'Text or combo box changed

'Return to main dialog
MainDialogProc = TRUE

Case 4 'Control focus changed
'* hWnd = GetForegroundWindow()
'* If hWnd > 0 Then
'* x = SetWindowText(hwnd, HelloMsg)
'* End If
'Return to main dialog
MainDialogProc = TRUE

Case 5 'Idle - use this case to update from events on the host (if any)

'Return to main dialog
MainDialogProc = TRUE

End Select
End Function

You could use the Win32API to get the foreground Window handle and set the title bar string (i.e.. remove the '* comment from Case 4 in gialog handler).

I'd prefer to have this addressed in the product. Can you open a call with customer care and have them document the issue for development?

Tom

Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba

Thanks for your answer. But, if you add a GoupBox in Dialog this does not work anymore :

Begin Dialog myDialog 1 , 1 , 186 , 92 , HelloMsg, .MainDialogProc

GroupBox 12, 28, 62, 57, "Fichier"

OkButton 130, 6, 50, 14, .OkButton

CancelButton 130, 23, 50, 14, .CancelButton

End Dialog

 

Have you a solution ?


Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba

Salut Patrick,

indeed, that is a little strange and surprising. There appears to be an easy workaround and it is to put the button controls first when defining the Dialog.

e.g.
Sub Main
HelloMsg = "My Title String"

Begin Dialog myDialog 107,139,419,194, "My Window", .MainDialogProc
OKButton 28,68,40,14, .OkButton
CancelButton 120,68,40,14, .CancelButton
GroupBox 12,8,72,52,"GroupBox1"
GroupBox 100,8,72,52,"GroupBox2"
OptionGroup .OptionGroup1
OptionButton 16,24,54,8,"OptionButton",.OptionButton1
OptionButton 16,40,54,8,"OptionButton",.OptionButton2
CheckBox 108,24,45,8,"CheckBox",.CheckBox1
CheckBox 108,40,45,8,"CheckBox",.CheckBox2
End Dialog
Dim MyDlg as myDialog
RetC = Dialog(MyDlg)
End Sub

Function MainDialogProc(id$, action%, suppvalue&)

Dim hWnd As Long, x As Long, ForegroundSessionName As String
Select Case action%
Case 1 'Initialize dialog controls
'Return to main dialog
MainDialogProc = TRUE
Case 2 'One of the buttons or checkboxes was pressed
Select Case id$
Case "OptionButton1"
HelloMsg = "OptionButton1"
SetTitleString HelloMsg
Case "OptionButton2"
HelloMsg = "OptionButton2"
SetTitleString HelloMsg
Case "CheckBox1"
HelloMsg = "CheckBox1"
SetTitleString HelloMsg
Case "CheckBox2"
HelloMsg = "CheckBox2"
SetTitleString HelloMsg
Case "OkButton"
'Return to main dialog
MainDialogProc = TRUE
MsgBox "You pressed OK"
Case "CancelButton"
MainDialogProc = FALSE
MsgBox "You pressed Cancel"
Case Else
MainDialogProc = FALSE
End Select
Case 3 'Text or combo box changed
'Return to main dialog
MainDialogProc = TRUE
Case 4 'Control focus changed
SetTitleString HelloMsg
hWnd = GetForegroundWindow
If hWnd > 0 Then
x = SetWindowText(hwnd, HelloMsg)
End If
'Return to main dialog
MainDialogProc = TRUE
Case 5 'Idle - use this case to update from events on the host (if any)
'Return to main dialog
MainDialogProc = TRUE
End Select
End Function

Sub SetTitleString(HelloMsg as String)
hWnd = GetForegroundWindow
If hWnd > 0 Then
x = SetWindowText(hwnd, HelloMsg)
End If
End Sub

The above works for me.

You mentioned that you are using Rumba 7.3. Unfortunately that version is quite old and has not been supported for several years. It was never tested on any currently supported version of MS Windows and does not support secure connection (i.e. current revs of secure protocols, TLS1.2, SSH SHA-2 certificates etc.). You should really consider moving to a current version or at minimum testing the current version to ensure it does everything you need, just in case 7.3 stops working overnight or some regulatory mandate forces you to securely encrypt your datastream.

Tom


Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba
Thank you very very mutch ! It works Perfectly.

From my few investigations this will be a focus problem (but I may be wrong)

however, I don't understand why you add a call SetTitleString while already exist in Case 4?

For change of version, I don't have the hand, it's not me who decides.

Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba
Apologies Patrick,

by bad, I forgot to remove those bits and bobs from Case 4, you are correct it should looks like..

Case 4 'Control focus changed
SetTitleString HelloMsg
'Return to main dialog
MainDialogProc = TRUE

As for root cause of GroupBox first problem, it's a strange one. If I reproduce the issue and then move a button above the group and execute it works. If I then move the group back to the top and execute it still works :-(.
Exiting the engine/editor, relaunching and executing it fails again. So I believe it's something else, no idea what though, frustrating, but better to proactively avoid if possible.

Tom

Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba

For the 'Case 4" it's useful if multi-use. But your first code without sub program, enought me.

Again geat thank for your help .

 

For other person below my code (anonymized) for my dailogue Box :

Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
Declare Function GetForegroundWindow Lib "user32" () As Long
Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Option explicit
Const ES_MULTILINE = &h0004&
Const ES_WANTRETURN = &h1000&
Const ES_READONLY = &h0800&
Const ES_CENTER = &h0001&

Global HelloMsg as String

Dim Message As String, Titre As String, Appli As String, Membre As String
Dim PremierMembre As Integer, Fichier As Integer, BibOrig As Integer, TypeFichier As Integer, Retour As Integer

Sub Main
Message = "Ici essai de message variable"
Titre = "Titre variable ici"
Membre = "ABCDEFGHIJK"
Appli = "Test final"
PremierMembre = 1
TypeFichier = 2
BibOrig = 2
    Call DlgDébut(Titre, Message, TypeFichier, Membre, Appli, BibOrig, PremierMembre)
End Sub

Sub DlgDébut(Titre, Message, TypeFichier, Membre, Appli, BibOrig, PremierMembre)
    Dim Fichier As Integer, Bib(6) As String

    Bib(0) = "AAAAA"
    Bib(1) = "SSSSS"
    Bib(2) = "MMMMM"
    Bib(3) = "GGGGGGG"
    Bib(4) = "MMMM"
    Bib(5) = "OOOOOOO"
    Bib(6) = "CCCCCCCC"

    Begin Dialog MyDialog 60, 70, 230, 180, Titre, .DlgFonction
        Text 5,5, 220,12, "", .DlgMessage, ES_CENTER
        CancelButton 65, 155, 40, 12
        OKButton 120, 155, 40, 12
        GroupBox 12, 28, 62, 57, "Fichier"
        OptionGroup .DlgFichier
            OptionButton 19, 38, 47, 12, "xxxx1"
            OptionButton 19, 48, 47, 12, "xxxx2"
            OptionButton 19, 58, 47, 12, "xxxx3"
            OptionButton 19, 68, 47, 12, "xxxx4"
        Text 113, 20, 55, 30,"Bib d'origine :"
        ListBox 110, 30, 55, 60, Bib() , .DlgBibOrig
        Text 12, 105, 35, 12,"Membre :"
        TextBox 46, 104, 70, 12, .DlgMembre
        CheckBox 120, 104, 10, 12, "", .DlgPremier
        Text 130, 102, 95, 22,"Si coché : Prendre le 1er "
        Text 12, 131, 35, 12,"Appli :"
        TextBox 46, 130, 120, 12, .DlgAppli
    End Dialog

    Dim Dlg_Var As MyDialog
    Dlg_Var.DlgFichier = TypeFichier
    Dlg_Var.DlgPremier = PremierMembre
    Dlg_Var.DlgBibOrig = BibOrig
    Dlg_Var.DlgAppli = Appli
    Dlg_Var.DlgMembre = Membre

    Retour = Dialog(Dlg_Var)
    If Retour = -1 Then
        MsgBox "Membre : " & Dlg_Var.DlgMembre
        MsgBox "Fichier : " & Dlg_Var.DlgFichier
        MsgBox "Pemier : " & Dlg_Var.DlgPremier
        MsgBox "BibOrig : " & Dlg_Var.DlgBibOrig
        MsgBox "Appli : " & Dlg_Var.DlgAppli
        End
    End If  

End Sub

Function DlgFonction(ControlID$, Action%, SuppValue&)
    Dim hWnd As Long, x As Long', ForegroundSessionName As String
    Select Case Action%
        Case 1                                    'Initialise les controls de la boite de dialogue
            DlgText  "DlgMessage", Message
            If PremierMembre = 1 Then
                DlgEnable "DlgMembre" ,0
            Else
                DlgEnable "DlgMembre" ,1
            End If

        Case 2                                    'Un des boutons ou case à cocher ont été utilisés
            Select Case ControlID$
                Case "DlgPremier"
                    Select Case SuppValue
                        Case 1
                            DlgEnable "DlgMembre" ,0
                        Case Else
                            DlgEnable "DlgMembre" ,1
                    End Select
            End Select
'            MainDialogProc = TRUE
        Case 3                                    'Text or combo box changed
            Select Case ControlID$
                Case "DlgMembre"
                    If Len(SuppValue) > 10 Then
                        MsgBox "NON"
                    End If
                End Select
            'Return to main dialog
            'MainDialogProc = TRUE
        Case 4                                    'Control focus changed
            hWnd = GetForegroundWindow()
            If hWnd > 0 Then
                x = SetWindowText(hwnd, Titre)
            End If
'            MainDialogProc = TRUE
        Case 5                                    'Idle - use this case to update from events on the host (if any)
            'Return to main dialog
'            MainDialogProc = TRUE
        End Select

End Function

 

Not Work currently in Dev...


Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba
OK I found : (In Case 3) replace If Len(SuppValue) > 10 Then
by : If SuppValue > 10 Then

Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba
Correct Patrick,

For ActionId=3 the SuppValue is the number of characters in the text box, or text box portion of the combo box or drop-down combo box.

Note you could also use

if Len(DlgText("DlgMembre"))>10 then
MsgBox "Nom de membre trop long, veuillez le modifier"
End If

Cheers,
Tom

Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba

Yes but how make for retrieve the value (in fctn dialog) of a ChekBox (ex : DlgPremier) ?

 

I Try DlgText("DlgPremier") but not work.


Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba

TomFiz (or other) have you a solution ?

 

There is another thing that I not understand : In the fonction the Case 3 is executed before Case 1.


Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba
Salut Patrick,

Case 2 handles the following: The user selected a button. checkbox, list, an item in a drop-down list or selected a previously unselected option button. The strID argument shows which control generated this action.

So for the DlgPremier control you can get whether to get the value you can use

Msgbox DlgValue("DlgPremier")

1=Checked
0=Unchecked

To set the value use

DlgValue "DlgPremier",0 'Unchecked
or
DlgValue "DlgPremier",1 'Checked

On Case 3 is executed before Case 1, this is correct. Case 1 indicates the dialog is about to be displayed, it executes before the dialog appears on the screen.

If you prefer not to have your Case 3 execute anything before the Case 1 have executed, then add a global isInitialised integer, set it =0 before you create the dialog. In Case 1 set the value of isInitilised = 1 and wrap your Case 3 code inside an If Isinitialised = 1 then ... End If

Tom

Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba

Thank Tom, I don't know why but, when I clic in checkBox (DlgPremier) I have a value 1 for Checked and nothing when uncheked It doesn't matter but it is necessary to know it. Therefore, when exit the DialogBox I have a value 0 if the checkbox is unchecked.

For "Case 3" here is my code :

    Dim InitOK As Boolean
    Select Case Action%
        Case 1                                    'Initialise les controls de la boite de dialogue
            InitOK = True

...

        Case 3                                     'Text or combo box changed
            Select Case ControlID$
                Case "DlgMembre"            'Zone texte Membre modifiée
                    If InitOK Then


Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba
That is rather strange Patrick,

what do you see if you add a Case "DlgPremier" to your code and pop a msgbox with the values of DlgPremier and SuppValue? They should both be the same and either 1 for checked and 0 for unchecked.

Case 2 'Un des boutons ou case à cocher ont été utilisés
Select Case ControlID$
Case "DlgPremier"
Msgbox ".DlgPremier = " & DlgValue ("DlgPremier") & Chr$(13) & Chr$(10) & "SuppValue = " & SuppValue

Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba
Tom,
If checked .DlgPremier = 1
SuppValue = 1

If Unchecked .DlgPremier = 0
SuppValue = 0


But I'm found another strangeness that is : If I add ES_MULTILINE behind a TextBox, this one is not executed at first passage in Case 3. I don't understand anything anymore !

Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba
Hi Patrick,

I can confirm the same behaviour in Rumba 9.5. My advise would be wrap the entire Case 3 block inside an

If InitOK Then
...
End If

clause, that way you can force the behaviour of Case 3 to only ever kick in after the dialog has been displayed. It's not ideal, but should make it consistent.

Tom

Morning,

 

I find how display a text variable ex :

TextBox 5,5, 220,12, .Message1

Where .Message1 is a variable text

 

And second question : How display the name of Dialog Box (in a same Begin Dialog) with a text variable ex:

 

...


#Rumba

Finally here is the code that works perfectly [:D]:

 

'Win32API DECLARATIONS
Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

Declare Function GetForegroundWindow Lib "user32" () As Long
Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long

'HLLAPI FUNCTION DECLARATIONS
Private Declare Function WD_ConnectPS Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal ShortName As String) As Integer
Private Declare Function WD_DisconnectPS Lib "EhlApi32.dll" (ByVal hInstance As Integer) As Integer
Private Declare Function WD_RunMacro Lib "EhlApi32.dll" (ByVal hInstance As Integer, ByVal Buffer As String) As Integer

Option explicit
Const ES_LEFT = &h0000&
Const ES_CENTER = &h0001&
Const ES_RIGHT = &h0002&
Const ES_MULTILINE = &h0004&
Const ES_UPPERCASE = &h0008&
Const ES_LOWERCASE = &h0010&
Const ES_PASSWORD = &h0020&
Const ES_AUTOVSCROLL = &h0040&
Const ES_AUTOHSCROLL = &h0080&
Const ES_NOHIDESEL = &h0100&
Const ES_OEMCONVERT = &h0400&
Const ES_READONLY = &h0800&
Const ES_WANTRETURN = &h1000&
Const ES_NUMBER = &h2000&

Dim MessageDlg As String, Titre As String, Appli As String, Membre As String
Dim PremierMembre As Integer, Fichier As Integer, BibOrig As Integer, Retour As Integer
Dim TypeFichier

Sub Main
MessageDlg = "Ici essai de message variable"
Titre = "Titre variable ici"
Membre = "ABCDEFGHIJK"
Appli = "12345678901234567890123456789012345678901234567890 "
PremierMembre = "1"
TypeFichier = 2
BibOrig = 2
    Call DlgDébut(Titre, MessageDlg, TypeFichier, Membre, Appli, BibOrig, PremierMembre)
End Sub

Sub DlgDébut(Titre, Message, TypeFichier, Membre, Appli, BibOrig, PremierMembre)
    Dim Fichier As Integer, Bib(6) As String

    Bib(0) = "BBBBB"
    Bib(1) = "Ssssss"
    Bib(2) = "MMMMMMM"
    Bib(3) = "Gggggg"
    Bib(4) = "MMMMMMMM"
    Bib(5) = "OOOOOO"
    Bib(6) = "CCCCCCCCCC"

    Begin Dialog MyDialog 60, 70, 230, 200, Titre, .DlgFonction
        Text 5, 5, 220, 12, "", .DlgMessage, ES_CENTER
        CancelButton 65, 180, 40, 12
        OKButton 120, 180, 40, 12, .OK
        GroupBox 12, 28, 62, 57, "Fichier"
        OptionGroup .DlgFichier
            OptionButton 19, 38, 47, 12, "111111"
            OptionButton 19, 48, 47, 12, "2222222"
            OptionButton 19, 58, 47, 12, "33333333"
            OptionButton 19, 68, 47, 12, "8888888888"
        Text 113, 20, 55, 30,"Bib d'origine :"
        ListBox 110, 30, 55, 60, Bib() , .DlgBibOrig
        Text 12, 105, 35, 12,"Membre :"
        TextBox 46, 104, 70, 12, .DlgMembre, ES_LEFT
        CheckBox 120, 104, 10, 12, "", .DlgPremier
        Text 130, 102, 95, 22,"Si coché : Prendre le 1er membre de la liste"
        Text 12, 121, 220,12, "", .DlgMsgMembre
        Text 12, 145, 25, 12,"Appli :"
        TextBox 46, 141, 165, 20, .DlgAppli, ES_MULTILINE
        Text 12, 163, 200,12, "", .DlgMsgAppli
    End Dialog

    Dim Dlg_Var As MyDialog
    Dlg_Var.DlgFichier = TypeFichier
    Dlg_Var.DlgPremier = PremierMembre
    Dlg_Var.DlgBibOrig = BibOrig
    Dlg_Var.DlgAppli = Appli
    Dlg_Var.DlgMembre = Membre

    Retour = Dialog(Dlg_Var)
    If Retour = -1 Then
        MsgBox "Membre : " & Dlg_Var.DlgMembre
        MsgBox "Fichier : " & Dlg_Var.DlgFichier
        MsgBox "Pemier : " & Dlg_Var.DlgPremier
        MsgBox "BibOrig : " & Dlg_Var.DlgBibOrig
        MsgBox "Appli : " & Dlg_Var.DlgAppli
        End
    End If  

End Sub

Function DlgFonction(ControlID$, Action%, SuppValue&)
    Dim hWnd As Long, x As Long', ForegroundSessionName As String
    Dim InitOK As Boolean
    Select Case Action%
        Case 1                                    'Initialise les controls de la boite de dialogue
            InitOK = True
            DlgText "DlgMessage", MessageDlg
            If PremierMembre = 1 Then
                DlgEnable "DlgMembre" ,0
                DlgEnable "OK", 1
            Else
                DlgEnable "DlgMembre" ,1
            End If
            If Len(DlgText("DlgAppli")) > 50 Then
                DlgText "DlgMsgAppli", "Appli 50 car. maxi. Actuellement : " & Len(DlgText("DlgAppli"))
                DlgEnable "OK", 0
            Else
                DlgEnable "OK", 1
            End If

        Case 2                                    'Un des boutons ou case à cocher ont été utilisés
            Select Case ControlID$
                Case "DlgPremier"        'Case à coché "1er Membre utilisée"
                    Select Case SuppValue
                        Case 1                    '"1er membre" coché donc Membre désactivé
                            DlgEnable "DlgMembre" ,0
                            DlgText "DlgMsgMembre", ""
                            If Len(DlgText("DlgAppli")) > 50 Then
                                DlgText "DlgMsgAppli", "Appli 50 car. maxi. Actuellement : " & Len(DlgText("DlgAppli"))
                                DlgEnable "OK", 0
                                Beep  
                            Else
                                DlgEnable "OK", 1
                            End If
                        Case Else                'Premier membre décoché donc Membre activé
                            DlgEnable "DlgMembre" ,1
                            If Len(DlgText("DlgMembre")) > 10 Then
                                DlgText "DlgMsgMembre", " 10 car. maxi. Actuellement : " & Len(DlgText("DlgMembre"))
                                DlgEnable "OK", 0
                                Beep
                            Else
                                If Len(DlgText("DlgAppli")) > 50 Then
                                    DlgText "DlgMsgAppli", "Appli 50 car. maxi. Actuellement : " & Len(DlgText("DlgAppli"))
                                    DlgEnable "OK", 0
                                    Beep
                                Else
                                    DlgEnable "OK", 1
                                End If
                            End If
                    End Select
                Case "OK"
                    If DlgText("DlgMembre") = "" And DlgValue("DlgPremier") <> 1 Then
                        Beep
                        DlgText "DlgMsgMembre", "Membre vide alors que ""Prendre 1er membre"" n'est pas cochée"
                        DlgEnable "OK", 0
                        DlgFonction = -1
                    End If
            End Select

        Case 3                                     'Text or combo box changed
            Select Case ControlID$
                Case = "DlgMembre"            'Zone texte Membre modifiée
                    If InitOK Then
                        If Len(DlgText("DlgMembre")) > 10 And DlgValue("DlgPremier") <> 1 Then
                            DlgText "DlgMsgMembre", "Appli 10 car. maxi. Actuellement : " & Len(DlgText("DlgMembre"))
                            DlgEnable "OK", 0
                        Else
                            DlgText "DlgMsgMembre", ""
                            If Len(DlgText("DlgAppli")) > 50 Then
                                DlgText "DlgMsgAppli", "Appli 50 car. maxi. Actuellement : " & Len(DlgText("DlgAppli"))
                                DlgEnable "OK", 0
                            Else
                                DlgText "DlgMsgAppli", ""
                                DlgEnable "OK", 1
                            End If
                        End If
                    End If
                Case = "DlgAppli"                'Zone texte Appli modifiée
                    If Len(DlgText("DlgAppli")) > 50 Then
                        DlgText "DlgMsgAppli", "Appli 50 car. maxi. Actuellement : " & Len(DlgText("DlgAppli"))
                        DlgEnable "OK", 0
                    Else
                        DlgText "DlgMsgAppli", ""
                        If Len(DlgText("DlgMembre")) > 10 And DlgValue("DlgPremier") <> 1 Then
                            DlgText "DlgMsgMembre", "Appli 10 car. maxi. Actuellement : " & Len(DlgText("DlgMembre"))
                            DlgEnable "OK", 0
                        Else
                            DlgText "DlgMsgMembre", ""
                            DlgEnable "OK", 1
                        End If
                    End If
            End Select
            'Return to main dialog
            'MainDialogProc = TRUE

        Case 4 'Control focus changed
            hWnd = GetForegroundWindow()
            If hWnd > 0 Then
                x = SetWindowText(hwnd, Titre)
            End If

        Case 5                                         'Idle - use this case to update from events on the host (if any)
print "Event from HOST"
            'Return to main dialog

        End Select
End Function

 

But the whole of my script is much longer.