c# - How get String from Textbox in windows Form -
i sccm administrator ,so planing make automation powershell using gui
so need input values windowsform. can me value texbox
[void] [system.reflection.assembly]::loadwithpartialname("system.drawing") [void] [system.reflection.assembly]::loadwithpartialname("system.windows.forms") #creating form $objform = new-object system.windows.forms.form $objform.text = "data entry form" $objform.size = new-object system.drawing.size(300,500) $objform.startposition = "centerscreen" #creating label $objlabel = new-object system.windows.forms.label $objlabel.location = new-object system.drawing.size(10,20) $objlabel.size = new-object system.drawing.size(280,20) $objlabel.text = "enter collection name" $objform.controls.add($objlabel) #creating teextbox $objtextbox = new-object system.windows.forms.textbox $objtextbox.location = new-object system.drawing.size(10,40) $objtextbox.size = new-object system.drawing.size(260,20) $objform.controls.add($objtextbox) #how take input textbox here??? #so can pass input string powershell commands
to set value in c# (e.g. text textbox) same way it! here example:
//to set text in textbox textbox1.text = "some text"; //to text textbox messagebox.show(textbox1.text); //the messagebox contain text textbox
hope helped you! :)
Comments
Post a Comment