ookii-dialogs-winforms icon indicating copy to clipboard operation
ookii-dialogs-winforms copied to clipboard

[Feature Request] Allow specification of Input Dialog width.

Open futuremotiondev opened this issue 10 months ago • 0 comments

With a System.Windows.Forms.Form, you can specify the dimensions (I'm using Powershell) via:

$form.Size = New-Object System.Drawing.Size(400, 200) # Set width to 400 pixels

However with an Ookii.Dialogs.WinForms.InputDialog instance, there is no way to specify the dialog width.

It would be great to do the following:

    Add-Type -AssemblyName System.Windows.Forms -ErrorAction Continue
    Add-Type -AssemblyName System.Drawing -ErrorAction Continue
    Add-Type -LiteralPath "$script:ModuleAssemblyRoot\Ookii.Dialogs.WinForms.4.0.0\net6.0-windows7.0\Ookii.Dialogs.WinForms.dll" -ErrorAction Continue
    [System.Windows.Forms.Application]::EnableVisualStyles()

    $IDialog                 = New-Object Ookii.Dialogs.WinForms.InputDialog
    $IDialog.MainInstruction = $MainInstruction
    $IDialog.Content         = $MainContent
    $IDialog.WindowTitle     = $WindowTitle
    $IDialog.Input           = $InputText
    $IDialog.MaxLength       = $MaxLength
    $IDialog.Multiline       = $Multiline
    $IDialog.DialogWidth     = 380 # Set the dialog width to 380px

    [System.Windows.Forms.Form] $TheForm = New-Object -TypeName System.Windows.Forms.Form
    $TheForm.StartPosition = [System.Windows.Forms.FormStartPosition]::CenterScreen
    $TheForm.TopMost = $true
    $TheForm.TopLevel = $true
    
    $Result = $IDialog.ShowDialog($TheForm)

Specifically this line:

$IDialog.DialogWidth = 380 # Set the dialog width to 380px

Any chance of implementation?

futuremotiondev avatar Jun 12 '25 22:06 futuremotiondev