microt
#1
Is there a generic Glide control object to get the name
So I can use the same call back for all my objects
private static void WinConfig_OnTap(object sender)
{
Debug.Print("WinConfig_OnTap");
try
{
CheckBox tCB = (CheckBox)sender;
or
TextBox tTB = (TextBox)sender;
@ microt - DisplayObject is the common parent.
microt
#3
Very nice, it worked…Thanks
private static void WinConfig_OnTap(object sender)
{
Debug.Print("WinConfig_OnTap");
try
{
DisplayObject iBase = (DisplayObject)sender;
TextBox tTB = null;
CheckBox tCB = null;
//Button tBT = null;
int i = int.Parse(iBase.Name.Substring(2));
switch(iBase.Name.Substring(0,2))
{
case "TB":
tTB = (TextBox)MicGlide.WinConfig.GetChildByName("TB" + i);
break;
case "CB":
tCB = (CheckBox)MicGlide.WinConfig.GetChildByName("CB" + i);
break;
case "BT":
//tBT = (Button)MicGlide.WinConfig.GetChildByName("BT" + i);
break;
}
You can also use something like this:
if( typeof(TextBox) == sender.GetType() )