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.
This topic is 10 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
R1Johnny
Posts: 37
Last visit: Mon Dec 12, 2022 7:15 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 2513 times
Does this make sense?

Thanks very much.
John
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

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
Last visit: Mon Dec 12, 2022 7:15 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.
:)
This topic is 10 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked