Hi, in my attempt to convert controls split between the form and a panel into tabpages, I have run in to a strange problem. The textbox that resided on a panel, was cut and pated into a tabpage of tabcontrol. Now I can not figure out a way to access the text property of that text box, $textbox.text. It there adifferent way to access this property now that the text box is a child of a tabpage instead of a panel?
Thank you
$textbox.text value no longer accessible
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- cs_engineering
- Posts: 10
- Last visit: Mon Oct 31, 2022 7:12 am
Re: $textbox.text value no longer accessible
[TOPIC MOVED TO POWERSHELL GUI BY MODERATOR]
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- cs_engineering
- Posts: 10
- Last visit: Mon Oct 31, 2022 7:12 am
Re: $textbox.text value no longer accessible
$textboxLogonName
It was working correctly and it's contents were accessible when it was a child of a panel control. Once I did cut (from panel) and Paste (into $tabpage1 of $tabcontrol) I can no longer get to the contents.
It actually turns out that the entire set of controls, two textbox controls used for input and a a button used to execute a procedure when clicked, no longer work once they were pasted into the $tabpage
It was working correctly and it's contents were accessible when it was a child of a panel control. Once I did cut (from panel) and Paste (into $tabpage1 of $tabcontrol) I can no longer get to the contents.
It actually turns out that the entire set of controls, two textbox controls used for input and a a button used to execute a procedure when clicked, no longer work once they were pasted into the $tabpage
Re: $textbox.text value no longer accessible
What is the name of the control as displayed on the properties page on the panel in the designer. YO are giving me the name of a variable. I need the name you see in the designer on the control properties page. Look at the "Name" property in the list.
- cs_engineering
- Posts: 10
- Last visit: Mon Oct 31, 2022 7:12 am
Re: $textbox.text value no longer accessible
#### Solved ##########
Turns out when you cut and past a control, say a $button from any parent location and make it a child of a new parent, the default action / event may get dropped. In my case, every button had it's onClick Action set to $NULL / blank and needs to be pointed back to the correct function.
Turns out when you cut and past a control, say a $button from any parent location and make it a child of a new parent, the default action / event may get dropped. In my case, every button had it's onClick Action set to $NULL / blank and needs to be pointed back to the correct function.
Re: $textbox.text value no longer accessible
AS for you question in support.
When creating a tab control it is necessary to carefully select the tab page then be sure you have the tab page container selected before dropping in or copying a control.
The more complex controls are really control containers and have multiple parts. dropping incorrectly can cause odd things to happen. Once you master cutting and pasting with controls or when moving a control from one place to another then this is easy.
When copying a control at any time the events are NEVER copied. Only cut/paste or drag/move/drop keeps the events. This is actually true of all things in Windows.
The events have nothing to do with assigning text or reading the controls text property.
Designing and coding with Windows forms for anyone with no forms or designer experience is a bit of a challenge because many things are counter-intuitive. The designer also follows all Windows standards which is not true of many GUI programs. The Sapien designer is based on Visual Studio and follows all standards for a VS type designer. It is a tool that is designed to make programming a GUI easier and is not like many GUI programs. Once you get used to the techniques it becomes very easy to use. The tab control always gets every new user because its behavior has to be complex. C# code will not work well when using the designer but can be used as a template for how to alter the control with script once you learn the properties that can break the control in the designer.
When creating a tab control it is necessary to carefully select the tab page then be sure you have the tab page container selected before dropping in or copying a control.
The more complex controls are really control containers and have multiple parts. dropping incorrectly can cause odd things to happen. Once you master cutting and pasting with controls or when moving a control from one place to another then this is easy.
When copying a control at any time the events are NEVER copied. Only cut/paste or drag/move/drop keeps the events. This is actually true of all things in Windows.
The events have nothing to do with assigning text or reading the controls text property.
Designing and coding with Windows forms for anyone with no forms or designer experience is a bit of a challenge because many things are counter-intuitive. The designer also follows all Windows standards which is not true of many GUI programs. The Sapien designer is based on Visual Studio and follows all standards for a VS type designer. It is a tool that is designed to make programming a GUI easier and is not like many GUI programs. Once you get used to the techniques it becomes very easy to use. The tab control always gets every new user because its behavior has to be complex. C# code will not work well when using the designer but can be used as a template for how to alter the control with script once you learn the properties that can break the control in the designer.