Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro Substitution in C#
Message
From
30/09/2005 07:27:07
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
30/09/2005 05:32:27
Vassilis Aggelakos
Themelio Software (Galatas Panayiotis)
Athens, Greece
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01054795
Message ID:
01054817
Views:
35
>Hi All,
>
>I try to make my first steps in DotNet world and I would like to ask you three (simple ?) questions.
>
>1. In C# (VS 2003) Is possible to execute a method for a control when we have its name in a variable ?
> In my VFP framework I do this:
> IF VARTYPE(thisform.cfrmpanel)="C" then
> lcObjectName = "thisform." + thisform.cFrmPanel
> EVALUATE(lcObjectName + ".OnBeforeClose()")
> ENDIF
>
> Is it possible with C# ?
>
>2. Is possible to add a variable class control in a form like this ?
>
> lcPanelName = "myXpanel"
> thisform.AddObject(lcPanelName,lcPanelName)
>
>3. Is there a With Statement (or equivalent) in C# ?
>
> lcObjectName = "thisform." + lcPanelName
> IF VARTYPE(lcObjectName)="O" THEN
> WITH &lcObjectName
> .top = this.xpanel_guide1.Top
> .left = this.xpanel_guide1.Left
> .width = this.xpanel_guide1.Width
> ENDWITH
> ENDIF
>
>Thanks in Advance
>Vassilis Aggelakos

Vassilis,
Check Thread #1004810
It answers partially. Basically your questions is about reflection and IMHO reflection is not an easy topic for the beginner.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform