|
Débuté par DT, 05 fév. 2004 14:41 - 2 réponses |
| |
| | | |
|
| |
Posté le 05 février 2004 - 14:41 |
Hi I need a code example for the following problem, did not seem that difficult to achieve until I tried so I suspect it is incorrect syntax on my part ==== Declared 4 variables as String MyString1, MyString2,Mystring3,ControlClic Place 3 controls on MyWindow as MyControl1,MyControl,MyControl (Edit,Multiline,Actif) When I clic on any of the above controls the code ControlClic=Myself.Name is executed - This works OK i.e. ControlClic contains name of MyControl2 Perorming other selections will update MyString1, MyString2 and Mystring3 with values - This works OK Trace shows that all variables have the correct values What I now need to do is populate the selected control - so a button calls a procedure which contains the code MyWindow.ControlClic = MyString1+TAB+ MyString2+TAB+Mystring3 - Nothing happens, no update??? Also tried {MyWindow+".ControlClic"} = Nothing??? Substituting the variable for the control name (MyWindow.MyControl1=) works fine ==== In case it should make a difference?? the window has a menu bar and is declared as the 1st application window Any advice as ever will be very much appreciated Regards DerekT |
| |
| |
| | | |
|
| | |
| |
Posté le 05 février 2004 - 14:58 |
Sorry, but I don't understand! Raimudn
Hi I need a code example for the following problem, did not seem that difficult to achieve until I tried so I suspect it is incorrect syntax on my part ==== Declared 4 variables as String MyString1, MyString2,Mystring3,ControlClic Place 3 controls on MyWindow as MyControl1,MyControl,MyControl (Edit,Multiline,Actif) When I clic on any of the above controls the code ControlClic=Myself.Name is executed - This works OK i.e. ControlClic contains name of MyControl2 Perorming other selections will update MyString1, MyString2 and Mystring3 with values - This works OK Trace shows that all variables have the correct values What I now need to do is populate the selected control - so a button calls a procedure which contains the code MyWindow.ControlClic = MyString1+TAB+ MyString2+TAB+Mystring3 - Nothing happens, no update??? Also tried {MyWindow+".ControlClic"} = Nothing??? Substituting the variable for the control name (MyWindow.MyControl1=) works fine ==== In case it should make a difference?? the window has a menu bar and is declared as the 1st application window Any advice as ever will be very much appreciated Regards DerekT
http://www.invitec.com |
| |
| |
| | | |
|
| | |
| |
Posté le 05 février 2004 - 16:01 |
Hi I need a code example for the following problem, did not seem that difficult to achieve until I tried so I suspect it is incorrect syntax on my part ==== Declared 4 variables as String MyString1, MyString2,Mystring3,ControlClic Place 3 controls on MyWindow as MyControl1,MyControl,MyControl (Edit,Multiline,Actif) When I clic on any of the above controls the code ControlClic=Myself.Name is executed - This works OK i.e. ControlClic contains name of MyControl2 Perorming other selections will update MyString1, MyString2 and Mystring3 with values - This works OK Trace shows that all variables have the correct values What I now need to do is populate the selected control - so a button calls a procedure which contains the code MyWindow.ControlClic = MyString1+TAB+ MyString2+TAB+Mystring3 - Nothing happens, no update??? Also tried {MyWindow+".ControlClic"} = Nothing??? Substituting the variable for the control name (MyWindow.MyControl1=) works fine ==== In case it should make a difference?? the window has a menu bar and is declared as the 1st application window Any advice as ever will be very much appreciated Regards DerekT Hey, DerekT ! Do you know you cannot do multiple control selection ? Each control get istself the focus. Though i don't understand what you mean with 'populate'. If you need to simply get the hole list when no control is selected, it's either impossible as there is at least one TABStopped control. Elsewhere, be aware indirection ({} use to built window components) is suitable with : - each control for each opened window - each active vars for each opened window (careful with viewness : globals are of course ok) It is why you can write {MyWindow+".ControlClic"} as it is a variable and not a control ! it you need de know timelined selected controls you only need to concatenate names into you var at reach control clic : ControlClic=Myself.Name will become ControlClic+=Myself.Name take care to inster a name separator for further use : if ControlClic<>"" then ControlClic+=TAB ControlClic=Myself.Name Now : your var contain each clicked control in clic order and simply usable as follow : i is an integer = 1 sControlName is a string = ExtractString(ControlClic,i) While cControlName<>EOT info(sControlName) i++ sControlName = ExtractString(ControlClic,i) END Please note that TAB is default separator for ExtractString() an related windev functions. Hope this cooking code will help. Regards R&B
rbesset.net, french unofficial Windev gate |
| |
| |
| | | |
|
| | | | |
| | |
|