PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → myself..
myself..
Débuté par joe crevino, 12 aoû. 2004 03:30 - 5 réponses
Posté le 12 août 2004 - 03:30
Is there a way to find out what the control myself.. is ie listbox,field,etc.
thank you,
joe
Posté le 12 août 2004 - 08:47
G'day Joe
I am not aware of any specific control.. property to give this info but the TypeVar and DataType functions may give you some assistance
The DataType function will show as backward compatible v55 command in your error list but it is actually fully supported in V8
Regards
Al
Posté le 12 août 2004 - 09:03
Is there a way to find out what the control myself.. is ie listbox,field,etc.
thank you,
joe

Maybe
..type

WinDevUS website
Posté le 12 août 2004 - 10:01
G'day Joe
The local procedure Refresh() in the GPWConfigurationDetails.wdw may give you some ideas as it enumerates a window's controls and puts them into a combobox by their type.
Regards
Al
Posté le 12 août 2004 - 16:28
Is there a way to find out what the control myself.. is ie listbox,field,etc.
thank you,

Yes, the property Type is just for this purpose.
For instance
TypeResult is int //(or string)
TypeResult = MySelf..Type
Info("Type result is " + TypeResult)
Info("ActiveX is " + typActiveX + CR + "Barcode is " + typBarCode + CR +
"Button is " + typButton)
The property ..type returns an integer which is actually a constant representing a particular type of object. It's then a matter of establishing what control/object the constant represents. The second Info line is just an illustration to show a few of the constants. In this example, an ActiveX is 17, a Barcode is 26 and a Button is 4.
For a fuller explanation, go to the Help file and under the Index tab type in "..Type" (without the quotes). You see all the different controls returned by the ..type property plus a couple of restrictions on its use.
I can't find a list of what constants are returned by each control/object type. However you don't need this is you just want to check whether Myself is a particular type of object. For instance:
IF Myself..type = typComboWE //combo with input
etc.
Alternatively you could use the SWITCH/CASE syntax for testing a number of conditions:
SWITCH Myself..Type
CASE typActiveX
...
CASE typWin
...
CASE typImage
etc.
HTH
Chris
Melbourne, Oz
Posté le 13 août 2004 - 03:56
typScrollbar=5
typButton%6
typDateQ4
typTimeQ5
typCurrencyQ6
typNumQ3
typTextQ2
typOle
typComboWE 49
typComboNE 48
typWin=1
typGrp=2
typImage=7
typCheckBox
typStatic=4
typList24
typTreeView
typOCX=9
TypOmbreFloue
typTab=8
typPLAN=3
typSlider
typSélect
typSpin
typTABFIC@96
typTABMEM@97
typClick=6
these are some of the codes returned by myself..type