tabcontrol1 - how to change location and size?

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 1 year and 4 months 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
lontru
Posts: 103
Last visit: Thu Mar 07, 2024 2:00 pm

tabcontrol1 - how to change location and size?

Post by lontru »

I have a gui where i want to move the tabcontrol1 when a specific tab is selected and change the size to

How do i change the size?

tried this but doesnt work?

$tabcontrol1.Size = New-Object System.Drawing.Size (660, 633)
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: tabcontrol1 - how to change location and size?

Post by jvierra »

The following method can be used to change the size and location of the TC.

https://learn.microsoft.com/en-us/dotne ... tem-int32)
User avatar
lontru
Posts: 103
Last visit: Thu Mar 07, 2024 2:00 pm

Re: tabcontrol1 - how to change location and size?

Post by lontru »

thanks

this did the trick

$tabControl1.Location = New-Object System.Drawing.Point(12, 93)
$tabControl1.Size = New-Object System.Drawing.Size(660, 560)
This topic is 1 year and 4 months 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