OT formas con powershell (me acabo de enterar)

6 views
Skip to first unread message

Ciro Vargas C

unread,
Jan 25, 2026, 8:47:47 PM (5 days ago) Jan 25
to oo...@googlegroups.com


Hola Todos


siempre pense que powershell era solo para comandos del sistema

pero resulta que tambien se puedne hacer ventanas.

miren este sencillo ejemplo se entiende muy facil

lo probe y funciona bien.

POWERSHELL

# Load the Windows Forms assembly
Add-Type -AssemblyName System.Windows.Forms

# Create a new form
$form = New-Object System.Windows.Forms.Form
$form.Text = "Simple GUI Example"
$form.Size = New-Object System.Drawing.Size(300, 200)
$form.StartPosition = 'CenterScreen'

# Create the first text box
$textBox1 = New-Object System.Windows.Forms.TextBox
$textBox1.Location = New-Object System.Drawing.Point(10, 20)
$textBox1.Size = New-Object System.Drawing.Size(260, 20)
$form.Controls.Add($textBox1)

# Create the second text box
$textBox2 = New-Object System.Windows.Forms.TextBox
$textBox2.Location = New-Object System.Drawing.Point(10, 60)
$textBox2.Size = New-Object System.Drawing.Size(260, 20)
$form.Controls.Add($textBox2)

# Create the first button
$button1 = New-Object System.Windows.Forms.Button
$button1.Text = "Show Text 1"
$button1.Location = New-Object System.Drawing.Point(10, 100)
$button1.Add_Click({
    [System.Windows.Forms.MessageBox]::Show("Text Box 1: " + $textBox1.Text)
})
$form.Controls.Add($button1)

# Create the second button
$button2 = New-Object System.Windows.Forms.Button
$button2.Text = "Show Text 2"
$button2.Location = New-Object System.Drawing.Point(150, 100)
$button2.Add_Click({
    [System.Windows.Forms.MessageBox]::Show("Text Box 2: " + $textBox2.Text)
})
$form.Controls.Add($button2)

# Show the form
$form.ShowDialog()

Ricardo Sassy

unread,
Jan 25, 2026, 9:35:28 PM (5 days ago) Jan 25
to oo...@googlegroups.com

Hola Ciro.

Lo probé y funciona perfecto pero no se me ocurre la utilidad que pueda tener esto…

¿Alguna idea?.

 

Saludos...

Ricardo Sassy

 

--
Has recibido este mensaje porque estás suscrito al grupo "[oohg]" de Grupos de Google.
Para cancelar la suscripción a este grupo y dejar de recibir sus mensajes, envía un correo electrónico a oohg+uns...@googlegroups.com.
Para ver este debate, visita https://groups.google.com/d/msgid/oohg/CALMx0uCFFSuHS486UiR9_Sr3Lwn_fKvO4AoHYWa0xFVBWXO8xA%40mail.gmail.com.

HECTOR RUBEN MELCER

unread,
Jan 26, 2026, 7:36:50 AM (5 days ago) Jan 26
to oo...@googlegroups.com

Ciro Vargas C

unread,
Jan 26, 2026, 7:46:09 AM (5 days ago) Jan 26
to oo...@googlegroups.com
Hay veces q se usan bats o powershell con entrada de datos preguntas o menus y con esto en vez de hacerlo en modo texto lo puedes hacer en modo gráfico, ahora te cuento más, seguí investigando y puedes ponerle tamaño a la ventana y, cambiar colores puedes usar dbf y leerlos hasta tmysql lo puedes usar con powershell, esto es. Como otro mundo de programación. Y no solo están esos controlles puedes usar todos los controles 


Saludos 

Ciro Vargas C

unread,
Jan 26, 2026, 8:52:53 AM (5 days ago) Jan 26
to oo...@googlegroups.com


actualice el ejemplo con muchos controles y menus hasta grids

esto lo puedes generar fácilmente con copilot que es especialsita en windows

solo le pides que quieres hacer y listo


Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing

#===========================================================
# FUNCIONES DE DEMO
#===========================================================

function Show-TextBoxDemo {
    $form = New-Object System.Windows.Forms.Form
    $form.Text = "Demo TextBox"
    $form.Size = "400,250"
    $form.StartPosition = "CenterScreen"
    $form.BackColor = "LightBlue"

    $label = New-Object System.Windows.Forms.Label
    $label.Text = "Escribe tu nombre:"
    $label.Location = "20,20"
    $label.AutoSize = $true

    $textbox = New-Object System.Windows.Forms.TextBox
    $textbox.Location = "20,50"
    $textbox.Width = 250

    $button = New-Object System.Windows.Forms.Button
    $button.Text = "Saludar"
    $button.Location = "20,90"
    $button.BackColor = "LightGreen"
    $button.Add_Click({
        [System.Windows.Forms.MessageBox]::Show("Hola, $($textbox.Text)!")
    })

    $form.Controls.AddRange(@($label,$textbox,$button))
    $form.ShowDialog()
}

function Show-SliderDemo {
    $form = New-Object System.Windows.Forms.Form
    $form.Text = "Demo Slider"
    $form.Size = "400,200"
    $form.StartPosition = "CenterScreen"
    $form.BackColor = "Lavender"

    $track = New-Object System.Windows.Forms.TrackBar
    $track.Location = "20,20"
    $track.Minimum = 0
    $track.Maximum = 100
    $track.Width = 300

    $label = New-Object System.Windows.Forms.Label
    $label.Location = "20,70"
    $label.AutoSize = $true
    $label.Text = "Valor: 0"

    $track.Add_ValueChanged({
        $label.Text = "Valor: $($track.Value)"
    })

    $form.Controls.AddRange(@($track,$label))
    $form.ShowDialog()
}

function Show-ListViewDemo {
    $form = New-Object System.Windows.Forms.Form
    $form.Text = "Demo ListView"
    $form.Size = "450,300"
    $form.StartPosition = "CenterScreen"
    $form.BackColor = "MistyRose"

    $list = New-Object System.Windows.Forms.ListView
    $list.View = "Details"
    $list.FullRowSelect = $true
    $list.GridLines = $true
    $list.Size = "400,200"
    $list.Location = "20,20"

    $list.Columns.Add("ID",50)
    $list.Columns.Add("Nombre",150)
    $list.Columns.Add("Ciudad",150)

    $items = @(
        "1;Ciro;Davie",
        "2;Ana;Miami",
        "3;Juan;Orlando"
    )

    foreach ($i in $items) {
        $parts = $i.Split(";")
        $item = New-Object System.Windows.Forms.ListViewItem($parts[0])
        $item.SubItems.Add($parts[1])
        $item.SubItems.Add($parts[2])
        $list.Items.Add($item)
    }

    $form.Controls.Add($list)
    $form.ShowDialog()
}

function Show-GridDemo {
    $form = New-Object System.Windows.Forms.Form
    $form.Text = "Demo DataGridView"
    $form.Size = "550,300"
    $form.StartPosition = "CenterScreen"
    $form.BackColor = "Honeydew"

    $grid = New-Object System.Windows.Forms.DataGridView
    $grid.Size = "500,200"
    $grid.Location = "20,20"
    $grid.AutoSizeColumnsMode = "Fill"

    $table = New-Object System.Data.DataTable
    $table.Columns.Add("Producto")
    $table.Columns.Add("Precio")
    $table.Columns.Add("Stock")

    $table.Rows.Add("Laptop","1200","5")
    $table.Rows.Add("Mouse","20","50")
    $table.Rows.Add("Teclado","35","30")

    $grid.DataSource = $table

    $form.Controls.Add($grid)
    $form.ShowDialog()
}

function Show-ComboDemo {
    $form = New-Object System.Windows.Forms.Form
    $form.Text = "Demo ComboBox"
    $form.Size = "350,200"
    $form.StartPosition = "CenterScreen"
    $form.BackColor = "LightYellow"

    $combo = New-Object System.Windows.Forms.ComboBox
    $combo.Location = "20,20"
    $combo.Width = 200
    $combo.Items.AddRange(@("Rojo","Verde","Azul","Negro","Blanco"))

    $button = New-Object System.Windows.Forms.Button
    $button.Text = "Seleccionar"
    $button.Location = "20,60"
    $button.BackColor = "LightCoral"
    $button.Add_Click({
        [System.Windows.Forms.MessageBox]::Show("Elegiste: $($combo.SelectedItem)")
    })

    $form.Controls.AddRange(@($combo,$button))
    $form.ShowDialog()
}

function Show-CheckRadioDemo {
    $form = New-Object System.Windows.Forms.Form
    $form.Text = "Demo CheckBox / RadioButton"
    $form.Size = "350,250"
    $form.StartPosition = "CenterScreen"
    $form.BackColor = "LightCyan"

    $chk = New-Object System.Windows.Forms.CheckBox
    $chk.Text = "Activar opcion"
    $chk.Location = "20,20"

    $rb1 = New-Object System.Windows.Forms.RadioButton
    $rb1.Text = "Opcion A"
    $rb1.Location = "20,60"

    $rb2 = New-Object System.Windows.Forms.RadioButton
    $rb2.Text = "Opcion B"
    $rb2.Location = "20,90"

    $button = New-Object System.Windows.Forms.Button
    $button.Text = "Mostrar seleccion"
    $button.Location = "20,130"
    $button.BackColor = "Khaki"
    $button.Add_Click({
        $msg = "CheckBox: " + ($chk.Checked)
        $msg += "`nRadio: "
        if ($rb1.Checked) { $msg += "A" }
        elseif ($rb2.Checked) { $msg += "B" }
        else { $msg += "Ninguno" }
        [System.Windows.Forms.MessageBox]::Show($msg)
    })

    $form.Controls.AddRange(@($chk,$rb1,$rb2,$button))
    $form.ShowDialog()
}

function Show-CalendarDemo {
    $form = New-Object System.Windows.Forms.Form
    $form.Text = "Demo Calendario"
    $form.Size = "350,300"
    $form.StartPosition = "CenterScreen"
    $form.BackColor = "LavenderBlush"

    $cal = New-Object System.Windows.Forms.MonthCalendar
    $cal.Location = "20,20"

    $form.Controls.Add($cal)
    $form.ShowDialog()
}

function Show-ProgressDemo {
    $form = New-Object System.Windows.Forms.Form
    $form.Text = "Demo ProgressBar"
    $form.Size = "350,200"
    $form.StartPosition = "CenterScreen"
    $form.BackColor = "MintCream"

    $progress = New-Object System.Windows.Forms.ProgressBar
    $progress.Location = "20,20"
    $progress.Width = 250
    $progress.Minimum = 0
    $progress.Maximum = 100

    $button = New-Object System.Windows.Forms.Button
    $button.Text = "Iniciar"
    $button.Location = "20,60"
    $button.BackColor = "LightSkyBlue"
    $button.Add_Click({
        for ($i=0; $i -le 100; $i+=5) {
            $progress.Value = $i
            Start-Sleep -Milliseconds 100
        }
    })

    $form.Controls.AddRange(@($progress,$button))
    $form.ShowDialog()
}

function Show-TabsDemo {
    $form = New-Object System.Windows.Forms.Form
    $form.Text = "Demo Tabs"
    $form.Size = "400,300"
    $form.StartPosition = "CenterScreen"
    $form.BackColor = "AliceBlue"

    $tabs = New-Object System.Windows.Forms.TabControl
    $tabs.Size = "350,200"
    $tabs.Location = "20,20"

    $tab1 = New-Object System.Windows.Forms.TabPage
    $tab1.Text = "Pagina 1"
    $tab1.BackColor = "WhiteSmoke"

    $tab2 = New-Object System.Windows.Forms.TabPage
    $tab2.Text = "Pagina 2"
    $tab2.BackColor = "Beige"

    $label1 = New-Object System.Windows.Forms.Label
    $label1.Text = "Contenido de la pagina 1"
    $label1.Location = "20,20"

    $label2 = New-Object System.Windows.Forms.Label
    $label2.Text = "Contenido de la pagina 2"
    $label2.Location = "20,20"

    $tab1.Controls.Add($label1)
    $tab2.Controls.Add($label2)

    $tabs.TabPages.AddRange(@($tab1,$tab2))

    $form.Controls.Add($tabs)
    $form.ShowDialog()
}

function Show-ToastDemo {
    [System.Windows.Forms.MessageBox]::Show("Esto es una notificacion tipo Toast","Notificacion")
}

#===========================================================
# VENTANA PRINCIPAL
#===========================================================

$formMain = New-Object System.Windows.Forms.Form
$formMain.Text = "Super Demo GUI PowerShell"
$formMain.Size = "600,500"
$formMain.StartPosition = "CenterScreen"
$formMain.BackColor = "LightSteelBlue"

$menu = New-Object System.Windows.Forms.MenuStrip

$menuDemo = New-Object System.Windows.Forms.ToolStripMenuItem("Demos")
$menuDemo.DropDownItems.Add("TextBox y Boton", $null, { Show-TextBoxDemo })
$menuDemo.DropDownItems.Add("Slider", $null, { Show-SliderDemo })
$menuDemo.DropDownItems.Add("ListView", $null, { Show-ListViewDemo })
$menuDemo.DropDownItems.Add("Grid (DataGridView)", $null, { Show-GridDemo })
$menuDemo.DropDownItems.Add("ComboBox", $null, { Show-ComboDemo })
$menuDemo.DropDownItems.Add("CheckBox / RadioButton", $null, { Show-CheckRadioDemo })
$menuDemo.DropDownItems.Add("Calendario", $null, { Show-CalendarDemo })
$menuDemo.DropDownItems.Add("ProgressBar", $null, { Show-ProgressDemo })
$menuDemo.DropDownItems.Add("Tabs", $null, { Show-TabsDemo })
$menuDemo.DropDownItems.Add("Notificacion Toast", $null, { Show-ToastDemo })

$menu.Items.Add($menuDemo)
$formMain.MainMenuStrip = $menu
$formMain.Controls.Add($menu)

# LABEL GRANDE SIN ACENTOS
$labelTitulo = New-Object System.Windows.Forms.Label
$labelTitulo.Text = "DEMO - Seleccione una opcion del menu"
$labelTitulo.Font = New-Object System.Drawing.Font("Arial", 20, [System.Drawing.FontStyle]::Bold)
$labelTitulo.AutoSize = $true
$labelTitulo.ForeColor = "DarkBlue"
$labelTitulo.Location = "40,120"

$formMain.Controls.Add($labelTitulo)

$formMain.ShowDialog()


==================
saludos
--

Juan Carlos Ocampo de la Cruz

unread,
Jan 26, 2026, 10:48:49 AM (5 days ago) Jan 26
to oo...@googlegroups.com
Hola Ciro:

Gracias por el tip, yo solo había experimentado con el Visual Basic Script, por ejemplo este es un pequeño sintetizador de voz:

'Texto_a_voz.vbs
'Texto_a_Voz.vbs 26/11/2024 https://allusefulinfo.com/how-to-convert-text-into-audio-using-notepad-for-free/
Dim message, sapi
Set sapi = CreateObject("sapi.spvoice")
do
  message = InputBox("Introduzca texto a hablar","Sintetizador de voz")
  sapi.Speak message
loop until message=""

'Harbour http://hmgforum.com/viewtopic.php?p=7696 | Luis Vazquez, Chile, 19-01-2010
'Function SpeakIt(message)
'  sapi = CreateObject("SAPI.SpVoice")
'  sapi:Speak(message)
'  sapi:= NIL
'return nil

'Visual FoxPro http://www.davphantom.net/consultar.asp?id=303&op=1
'sapi = CreateObject("SAPI.SpVoice")
'sapi.Speak("Visual fox Pro")

Este es para linea de comandos y usarlo en mensajes hablados en .bat:

'Habla.vbs 13/07/2023
'script para mensajes hablados desde la linea de comandos
'Autor:Juan Carlos Ocampo de la Cruz

Dim objArgumentos, cMensaje, i, j

Set objArgumentos = WScript.Arguments
Set speech = Wscript.CreateObject("SAPI.spVoice")

j=objArgumentos.Count

If j>=1 Then
  for i=0 to j-1
    cMensaje=cMensaje&" "&objArgumentos(i)
  next
  speech.speak cMensaje
Else
  speech.speak "Sin palabras"
  MsgBox "Sintaxis: Habla palabra1 palabra2 ..."
End If

Sería interesante integrar el objeto SAPI.spVoice en tu demo.

Probe tu ejemplo, lo guarde como extensión .ps1 y botón derecho del ratón seleccionando el archivo y ejecutar con PowerShell.

Saludos


Ciro Vargas C

unread,
Jan 26, 2026, 11:34:52 AM (5 days ago) Jan 26
to oo...@googlegroups.com

Hola Juan Carlo me pareció interesante y util tu ejemplo

lo agregue al menú pero en version powershell

pasa texto a audio de una forma muy sencilla, a veces nos hacemios bolas haciendo esto de otra forma

como menciono Juan carlos guardenlo como  por ejemplo demo.ps1

y corranlo en una ventana de powershell

saludos


Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing

#===========================================================
# FUNCIONES DE DEMO
#===========================================================

function Show-TextBoxDemo {
    $form = New-Object System.Windows.Forms.Form

    $form.Text = "Demo TextBox"
    $form.Size = "400,250"
    $form.StartPosition = "CenterScreen"
    $form.BackColor = "LightBlue"

    $label = New-Object System.Windows.Forms.Label
    $label.Text = "Escribe tu nombre:"
    $label.Location = "20,20"
    $label.AutoSize = $true

    $textbox = New-Object System.Windows.Forms.TextBox
    $textbox.Location = "20,50"
    $textbox.Width = 250

    $button = New-Object System.Windows.Forms.Button
    $button.Text = "Saludar"
    $button.Location = "20,90"
    $button.BackColor = "LightGreen"
    $button.Add_Click({
        [System.Windows.Forms.MessageBox]::Show("Hola, $($textbox.Text)!")
    })

    $form.Controls.AddRange(@($label,$textbox,$button))
    $form.ShowDialog()
}

function Show-SliderDemo {
    $form = New-Object System.Windows.Forms.Form

    $form.Text = "Demo Slider"
    $form.Size = "400,200"
    $form.StartPosition = "CenterScreen"
    $form.BackColor = "Lavender"

    $track = New-Object System.Windows.Forms.TrackBar
    $track.Location = "20,20"
    $track.Minimum = 0
    $track.Maximum = 100
    $track.Width = 300

    $label = New-Object System.Windows.Forms.Label
    $label.Location = "20,70"
    $label.AutoSize = $true
    $label.Text = "Valor: 0"

    $track.Add_ValueChanged({
        $label.Text = "Valor: $($track.Value)"
    })

    $form.Controls.AddRange(@($track,$label))
    $form.ShowDialog()
}

function Show-ListViewDemo {
    $form = New-Object System.Windows.Forms.Form
    $form = New-Object System.Windows.Forms.Form

    $form.Text = "Demo DataGridView"
    $form.Size = "550,300"
    $form.StartPosition = "CenterScreen"
    $form.BackColor = "Honeydew"

    $grid = New-Object System.Windows.Forms.DataGridView
    $grid.Size = "500,200"
    $grid.Location = "20,20"
    $grid.AutoSizeColumnsMode = "Fill"

    $table = New-Object System.Data.DataTable
    $table.Columns.Add("Producto")
    $table.Columns.Add("Precio")
    $table.Columns.Add("Stock")

    $table.Rows.Add("Laptop","1200","5")
    $table.Rows.Add("Mouse","20","50")
    $table.Rows.Add("Teclado","35","30")

    $grid.DataSource = $table

    $form.Controls.Add($grid)
    $form.ShowDialog()
}

function Show-ComboDemo {
    $form = New-Object System.Windows.Forms.Form

    $form.Text = "Demo ComboBox"
    $form.Size = "350,200"
    $form.StartPosition = "CenterScreen"
    $form.BackColor = "LightYellow"

    $combo = New-Object System.Windows.Forms.ComboBox
    $combo.Location = "20,20"
    $combo.Width = 200
    $combo.Items.AddRange(@("Rojo","Verde","Azul","Negro","Blanco"))

    $button = New-Object System.Windows.Forms.Button
    $button.Text = "Seleccionar"
    $button.Location = "20,60"
    $button.BackColor = "LightCoral"
    $button.Add_Click({
        [System.Windows.Forms.MessageBox]::Show("Elegiste: $($combo.SelectedItem)")
    })

    $form.Controls.AddRange(@($combo,$button))
    $form.ShowDialog()
}

function Show-CheckRadioDemo {
    $form = New-Object System.Windows.Forms.Form
    $form = New-Object System.Windows.Forms.Form

    $form.Text = "Demo Calendario"
    $form.Size = "350,300"
    $form.StartPosition = "CenterScreen"
    $form.BackColor = "LavenderBlush"

    $cal = New-Object System.Windows.Forms.MonthCalendar
    $cal.Location = "20,20"

    $form.Controls.Add($cal)
    $form.ShowDialog()
}

function Show-ProgressDemo {
    $form = New-Object System.Windows.Forms.Form

    $form.Text = "Demo ProgressBar"
    $form.Size = "350,200"
    $form.StartPosition = "CenterScreen"
    $form.BackColor = "MintCream"

    $progress = New-Object System.Windows.Forms.ProgressBar
    $progress.Location = "20,20"
    $progress.Width = 250
    $progress.Minimum = 0
    $progress.Maximum = 100

    $button = New-Object System.Windows.Forms.Button
    $button.Text = "Iniciar"
    $button.Location = "20,60"
    $button.BackColor = "LightSkyBlue"
    $button.Add_Click({
        for ($i=0; $i -le 100; $i+=5) {
            $progress.Value = $i
            Start-Sleep -Milliseconds 100
        }
    })

    $form.Controls.AddRange(@($progress,$button))
    $form.ShowDialog()
}

function Show-TabsDemo {
    $form = New-Object System.Windows.Forms.Form

    $form.Text = "Demo Tabs"
    $form.Size = "400,300"
    $form.StartPosition = "CenterScreen"
    $form.BackColor = "AliceBlue"

    $tabs = New-Object System.Windows.Forms.TabControl
    $tabs.Size = "350,200"
    $tabs.Location = "20,20"

    $tab1 = New-Object System.Windows.Forms.TabPage
    $tab1.Text = "Pagina 1"
    $tab1.BackColor = "WhiteSmoke"

    $tab2 = New-Object System.Windows.Forms.TabPage
    $tab2.Text = "Pagina 2"
    $tab2.BackColor = "Beige"

    $label1 = New-Object System.Windows.Forms.Label
    $label1.Text = "Contenido de la pagina 1"
    $label1.Location = "20,20"

    $label2 = New-Object System.Windows.Forms.Label
    $label2.Text = "Contenido de la pagina 2"
    $label2.Location = "20,20"

    $tab1.Controls.Add($label1)
    $tab2.Controls.Add($label2)

    $tabs.TabPages.AddRange(@($tab1,$tab2))

    $form.Controls.Add($tabs)
    $form.ShowDialog()
}

# NUEVA FUNCION: TEXTO A AUDIO (TTS)
function Show-TTSDemo {
    $form = New-Object System.Windows.Forms.Form
    $form.Text = "Demo Texto a Audio"
    $form.Size = "450,250"
    $form.StartPosition = "CenterScreen"
    $form.BackColor = "LightPink"

    $label = New-Object System.Windows.Forms.Label
    $label.Text = "Escribe el texto que quieres escuchar:"

    $label.Location = "20,20"
    $label.AutoSize = $true

    $textbox = New-Object System.Windows.Forms.TextBox
    $textbox.Location = "20,50"
    $textbox.Width = 380
    $textbox.Height = 60
    $textbox.Multiline = $true

    $button = New-Object System.Windows.Forms.Button
    $button.Text = "Reproducir Audio"
    $button.Location = "20,130"
    $button.BackColor = "LightGreen"
    $button.Add_Click({
        $sapi = New-Object -ComObject "SAPI.SpVoice"
        $sapi.Speak($textbox.Text)
    })

    $form.Controls.AddRange(@($label,$textbox,$button))

    $form.ShowDialog()
}

function Show-ToastDemo {
    [System.Windows.Forms.MessageBox]::Show("Esto es una notificacion tipo Toast","Notificacion")
}

#===========================================================
# VENTANA PRINCIPAL
#===========================================================

$formMain = New-Object System.Windows.Forms.Form
$formMain.Text = "Super Demo GUI PowerShell"
$formMain.Size = "600,500"
$formMain.StartPosition = "CenterScreen"
$formMain.BackColor = "LightSteelBlue"

$menu = New-Object System.Windows.Forms.MenuStrip

$menuDemo = New-Object System.Windows.Forms.ToolStripMenuItem("Demos")
$menuDemo.DropDownItems.Add("TextBox y Boton", $null, { Show-TextBoxDemo })
$menuDemo.DropDownItems.Add("Slider", $null, { Show-SliderDemo })
$menuDemo.DropDownItems.Add("ListView", $null, { Show-ListViewDemo })
$menuDemo.DropDownItems.Add("Grid (DataGridView)", $null, { Show-GridDemo })
$menuDemo.DropDownItems.Add("ComboBox", $null, { Show-ComboDemo })
$menuDemo.DropDownItems.Add("CheckBox / RadioButton", $null, { Show-CheckRadioDemo })
$menuDemo.DropDownItems.Add("Calendario", $null, { Show-CalendarDemo })
$menuDemo.DropDownItems.Add("ProgressBar", $null, { Show-ProgressDemo })
$menuDemo.DropDownItems.Add("Tabs", $null, { Show-TabsDemo })
$menuDemo.DropDownItems.Add("Texto a Audio (TTS)", $null, { Show-TTSDemo })

$menuDemo.DropDownItems.Add("Notificacion Toast", $null, { Show-ToastDemo })

$menu.Items.Add($menuDemo)
$formMain.MainMenuStrip = $menu
$formMain.Controls.Add($menu)

# LABEL GRANDE SIN ACENTOS
$labelTitulo = New-Object System.Windows.Forms.Label
$labelTitulo.Text = "DEMO - Seleccione una opcion del menu"
$labelTitulo.Font = New-Object System.Drawing.Font("Arial", 20, [System.Drawing.FontStyle]::Bold)
$labelTitulo.AutoSize = $true
$labelTitulo.ForeColor = "DarkBlue"
$labelTitulo.Location = "40,120"

$formMain.Controls.Add($labelTitulo)

$formMain.ShowDialog()



--
Reply all
Reply to author
Forward
0 new messages