Neue Frage :D
Ich habe mit Primalforms eine simple From erstellt, und möchte, das diese sich mittels Autoscalemode automatisch anpasst.
Wenn ich nähmlich größere Funktionen benutze können diese auf kleineren Bildschirmen oft nicht ganz angezeigt werden und deshalb würde ich gerne wissen wie ich Autoscalemode anwenden kann?:)
Es ist doch bestimmt möglich auf eine Funktion (In diesem Fall GenerateForm) den Autoscalemode anzuwenden und damit alle Buttons, Listboxen, etc. in dieser Funktion automatisch skalieren zu lassen!?
#Generated Form Function function GenerateForm { ######################################################################## # Code Generated By: SAPIEN Technologies PrimalForms (Community Edition) v1.0.10.0 # Generated On: 19.07.2016 13:41 # Generated By: Kschneider ######################################################################## #region Import the Assemblies [reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null [reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null #endregion #region Generated Form Objects $form1 = New-Object System.Windows.Forms.Form $label1 = New-Object System.Windows.Forms.Label $listBox1 = New-Object System.Windows.Forms.ListBox $button1 = New-Object System.Windows.Forms.Button $InitialFormWindowState = New-Object System.Windows.Forms.FormWindowState #endregion Generated Form Objects #---------------------------------------------- #Generated Event Script Blocks #---------------------------------------------- #Provide Custom Code for events specified in PrimalForms. $button1_OnClick= { #TODO: Place custom script here } $OnLoadForm_StateCorrection= {#Correct the initial state of the form to prevent the .Net maximized form issue $form1.WindowState = $InitialFormWindowState } #---------------------------------------------- #region Generated Form Code $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Height = 362 $System_Drawing_Size.Width = 684 $form1.ClientSize = $System_Drawing_Size $form1.DataBindings.DefaultDataSourceUpdateMode = 0 $form1.Name = "form1" $form1.Text = "Primal Form" $label1.BorderStyle = 1 $label1.DataBindings.DefaultDataSourceUpdateMode = 0 $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 12 $System_Drawing_Point.Y = 12 $label1.Location = $System_Drawing_Point $label1.Name = "label1" $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Height = 80 $System_Drawing_Size.Width = 423 $label1.Size = $System_Drawing_Size $label1.TabIndex = 2 $label1.Text = "label1" $form1.Controls.Add($label1) $listBox1.DataBindings.DefaultDataSourceUpdateMode = 0 $listBox1.FormattingEnabled = $True $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 452 $System_Drawing_Point.Y = 12 $listBox1.Location = $System_Drawing_Point $listBox1.Name = "listBox1" $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Height = 342 $System_Drawing_Size.Width = 220 $listBox1.Size = $System_Drawing_Size $listBox1.TabIndex = 1 $form1.Controls.Add($listBox1) $button1.DataBindings.DefaultDataSourceUpdateMode = 0 $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 12 $System_Drawing_Point.Y = 296 $button1.Location = $System_Drawing_Point $button1.Name = "button1" $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Height = 54 $System_Drawing_Size.Width = 125 $button1.Size = $System_Drawing_Size $button1.TabIndex = 0 $button1.Text = "button1" $button1.UseVisualStyleBackColor = $True $button1.add_Click($button1_OnClick) $form1.Controls.Add($button1) #endregion Generated Form Code #Save the initial state of the form $InitialFormWindowState = $form1.WindowState #Init the OnLoad event to correct the initial state of the form $form1.add_Load($OnLoadForm_StateCorrection) #Show the Form $form1.ShowDialog()| Out-Null } #End Function #Call the Function GenerateForm
Danke für jede Hilfe
Grüße