Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Manipulating tabs in Powershell Gui

$
0
0

God evening,

 

I am writing a GUI that has multiple tab pages. The issue I am not able to overcome is when I tried to put a lot of buttons and controls to one of the tab, the tab didn't scrolled down and the buttons dissapeared because they didn't fit.

I tried the property "multiline' with no luck. 

The code I use is:

$TabControl = New-object System.Windows.Forms.TabControl

$System_Drawing_Point = New-Object System.Drawing.Point

$System_Drawing_Point.X = 5

$System_Drawing_Point.Y = 245

$tabControl.Location = $System_Drawing_Point

$tabControl.Name = "tabControl"

$TabControl.MultiLine = $True 

$System_Drawing_Size = New-Object System.Drawing.Size

$System_Drawing_Size.Height = 400

$System_Drawing_Size.Width = 900

$tabControl.Size = $System_Drawing_Size

$form.Controls.Add($tabControl)

 

$Configuration = New-Object System.Windows.Forms.TabPage

$Configuration .DataBindings.DefaultDataSourceUpdateMode = 0

$Configuration .UseVisualStyleBackColor = $True

$Configuration .Name = "Quick Configuration"

$Configuration .Text = "Quick Configuration”

$Configuration .MultiLine = $True 

$tabControl.Controls.Add($QConf)

 

######Group Boxes in Configuration Tab Page########

$groupBoxControl1 = New-Object System.Windows.Forms.GroupBox 

$groupBoxControl1 .Location = New-Object System.Drawing.Size(5,10) #location of the group box (px) in relation to the primary window's edges (length, height)

$groupBoxControl1 .size = New-Object System.Drawing.Size(700,50) #the size in px of the group box (length, height)

$groupBoxControl1 .text = "Control 1" #labeling the box

$Configuration1.Controls.Add($groupBoxControl1 ) #activate the group box

 

I have multiple controls inside the group boxes and the groupboxes are alomot 50, so I would like to scroll down in this tab page and not to lose the group boxes.

 

Any ideas?

 

Thank you

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles