Eval Function in C# -


how can evaluate string in c# windows application because need dynamically select object in form based on combination of 2 string give me name of needed object

you can trycontrolcollection.find method find control name.
example:

myform.controls.find("foobutton", true); 

method returns array of control element name property set "foobutton".

there no c# eval equivalent. link can find useful answers. ofc, if want find or evaluate winform controls

update: think better control key directly. example:

control control = this.controls["footxtbox"]; if(control==null)         {             messagebox.show("control not found");         } control.text = "something"; 

Comments

Popular posts from this blog

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - Updating recent updates - Problem in procedure - Any other approach? -