IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Windows Forms Discussion :

Textbox & Label [Débutant]


Sujet :

Windows Forms

  1. #1
    Futur Membre du Club
    Homme Profil pro
    Architecte de système d'information
    Inscrit en
    Août 2016
    Messages
    4
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 32
    Localisation : France, Doubs (Franche Comté)

    Informations professionnelles :
    Activité : Architecte de système d'information
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Août 2016
    Messages : 4
    Points : 6
    Points
    6
    Par défaut Textbox & Label
    Bonjour à toutes & à tous,

    Je suis actuellement entrain de faire un script en Windows Form via PowerShell ISE.

    Pouvez-vous, s'il vous plaît, m'aiguiller sur une commande que je n'arrive malheureusement pas à trouver..

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
     
    # Label_1 : Champs de recherche d'un utilisateur
    $label_1 = New-Object System.Windows.Forms.Label
    $label_1.Size = New-Object System.Drawing.Size(350,20)
    $Label_1.Location = New-Object System.Drawing.Point(10,20)
    $label_1.Text = "Veuillez entrer le nom d'utilisateur concerné :"
     
    # Zone de texte_1
    $textbox_1 = New-Object System.Windows.Forms.TextBox
    $textbox_1.Size = New-Object System.Drawing.Size(260,20)
    $TextBox_1.Location = New-Object System.Drawing.Point(10,40)
    $form2.Controls.Add($textBox_1)
     
    $form2.Topmost = $true
     
    $form2.Add_Shown({$textbox_1.Select})
     
    if ($result_1 -eq [System.Windows.Forms.DialogResult]::OK)
    {
        $x 
        $x
    }
    Dans cette form, je souhaite afficher ce que j'ai mis dans ma textbox dans une seconde form en label ou autre ?

    Je vous remercie de l'aide apporté,

    Bonne journée/soirée

    PS :
    Voici ce que j'ai fais mais comme vous pouvez l'apercevoir, ça ne me montre rien :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    # Affichage du nom d'utilisateur recherché : "_ru" = Recherche Unitaire
    $label_ru = New-Object System.Windows.Forms.Label
    $label_ru.Text = $textbox_1
    $label_ru.Size = New-Object System.drawing.Size(160,30)
    $label_ru.Location = New-Object System.drawing.Point(30,10)

  2. #2
    Futur Membre du Club
    Homme Profil pro
    Architecte de système d'information
    Inscrit en
    Août 2016
    Messages
    4
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 32
    Localisation : France, Doubs (Franche Comté)

    Informations professionnelles :
    Activité : Architecte de système d'information
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Août 2016
    Messages : 4
    Points : 6
    Points
    6
    Par défaut Réponse
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
     
    [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
    [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
     
    $FormA = New-Object System.Windows.Forms.Form
    $FormA.Size = New-Object System.Drawing.Size(300,300)
     
    $TextBox1 = New-Object System.Windows.Forms.TextBox
    $TextBox1.Location = New-Object System.Drawing.Point(10,10)
    $FormA.Controls.Add($TextBox1)
     
     
    $Button = New-Object System.Windows.Forms.Button
    $Button.Location = New-Object System.Drawing.Point(10,50)
    $Button.Text = "Suivant"
    $FormA.Controls.Add($Button)
     
    $Button.Add_Click({
        $Script:Texte = $TextBox1.Text
        $FormA.Close()
    })
     
    $FormA.Add_Shown({ $FormA.Activate() })
     
    [void] $FormA.ShowDialog()
     
    $FormB = New-Object System.Windows.Forms.Form
    $FormB.Size = New-Object System.Drawing.Size(300,300)
     
    $TextBox2 = New-Object System.Windows.Forms.TextBox
    $TextBox2.Location = New-Object System.Drawing.Point(10,10)
    $TextBox2.Text = $Texte
    $FormB.Controls.Add($TextBox2)
     
    $FormB.Add_Shown({ $FormB.Activate() })
     
    [void] $FormB.ShowDialog()
    @Source - PowerShell-Scripting.com (http://powershell-scripting.com/inde...id=22134#22134)

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Création dynamiqe de textbox et labels
    Par tehes dans le forum ASP.NET
    Réponses: 6
    Dernier message: 15/01/2008, 14h54
  2. Création dynamiqe de textbox et labels
    Par tehes dans le forum ASP.NET
    Réponses: 3
    Dernier message: 14/01/2008, 17h59
  3. Format de durée dans TextBox ou Label
    Par gangsterus dans le forum VB.NET
    Réponses: 6
    Dernier message: 13/12/2007, 13h55
  4. [C#] [2.0] Hello World, textbox, button, label
    Par shako95 dans le forum ASP.NET
    Réponses: 2
    Dernier message: 05/12/2006, 15h33
  5. [VB6] Composer un LONG avec TextBox et Label
    Par Lucas42 dans le forum VB 6 et antérieur
    Réponses: 7
    Dernier message: 18/05/2006, 14h06

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo