Page 1 of 1

How to get the Control Types in a Dialog?

Posted: Sat Mar 25, 2006 3:14 pm
by RAMESHBABU
Can any body help me on how to get the Control Types in a Dialog.

Ex: I have some SAYS, GETS, RADIO BUTTONS, COMBO and BROWSE
controls on a Dialog. And I want to know the type of the current Control one which the user has clicked/pressed Enter Key.

TIA

Regards,

- Ramesh Babu P

Posted: Sat Mar 25, 2006 4:41 pm
by DanielPuente
Ramesh:

With oCtrl:ClassName() you will get the name of the control class, like "TGET", "TSAY", "TBUTTON", etc.

Regards,

Just A sample of what I do

Posted: Sat Mar 25, 2006 5:45 pm
by Mike Buckler
for x = 1 to len(odlg:acontrols)
classn = odlg:acontrols[x]:classname()
default classn:="\\"
if classn <> "\\"
if classn <> "TGET"
if classn <> "TWBROWSE"
aadd(items,{odlg:acontrols[x]:classname(),;
odlg:acontrols[x]:nid,;
odlg:acontrols[x]:hidden,;
oDlg:aControls[x]:ctitle,x})
ELSE
FOR Y = 1 TO LEN(oDlg:aControls[x]:aheaders)
TXT=TXT+RTRIM(oDlg:aControls[x]:aheaders[Y])+"|"
NEXT
aadd(items,{odlg:acontrols[x]:classname(),;
odlg:acontrols[x]:nid,;
odlg:acontrols[x]:hidden,;
TXT,x})
ENDIF
endif
endif
next

Posted: Thu Mar 30, 2006 1:22 am
by RAMESHBABU
Thanks to both of you Mr.Mike and Mr.Daniel.

Regards,

- Ramesh Babu P