Box that acts like textbox and label?

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
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.
Locked
User avatar
R1Johnny
Posts: 37
Joined: Thu Aug 18, 2011 12:22 am

Box that acts like textbox and label?

Post by R1Johnny »

Good morning,
Is there a box that acts like a textbox and a label box that can be updated by a timer event?

For instance, consider 2 boxes that represent percentages. I'd like to be able to change the value of either box and have the change also represented in the alternate box.

Say I input 30% in the first box. I'd like 70% automatically entered in the second box. If I change the second box to 40%, I'd like the first box to automatically change to 60%.

So, if I change the value in either box, the corresponding value would automatically be updated in the alternate box.
PerCentBoxs.JPG
PerCentBoxs.JPG (8.92 KiB) Viewed 1941 times
Does this make sense?

Thanks very much.
John

jvierra
Posts: 14573
Joined: Tue May 22, 2007 9:57 am
Answers: 1
Contact:

Re: Box that acts like textbox and label?

Post by jvierra »

Yes - both the text box and the label can be updated by a timer event.

Changing one box based on the change in another has nothing to do with a timer. Just catch the "change" event and do the update.

It sounds like you need some of the good old basics of Windows Forms to get you off on the right path.

Start here: http://www.sapien.com/blog/2012/06/04/u ... istrators/

The Sapien Blog is very good
This will step you through hos to use most of the controls in relation to doing basic admin type forms. Once you understand how forms work and what an "event model" is you should be able to do most things.

Post back if you find something that is not covered.

User avatar
R1Johnny
Posts: 37
Joined: Thu Aug 18, 2011 12:22 am

Re: Box that acts like textbox and label?

Post by R1Johnny »

I'll definitely do that.
Thanks very much.
PS: You're right. I do need the basics.
:)

Locked