Charger une Form

Résolu
victorcoasne Messages postés 1101 Date d'inscription jeudi 24 avril 2003 Statut Membre Dernière intervention 23 juillet 2023 - 19 juin 2006 à 11:21
PCPT Messages postés 13272 Date d'inscription lundi 13 décembre 2004 Statut Membre Dernière intervention 3 février 2018 - 19 juin 2006 à 22:53
Bonjour,

Je suis débutant en VB et travaille avec Microsoft VisualBasic 2005 Express Edition.

Cette question va vous paraître toute bête mais comment fais-ton pour afficher une autre fenêtre (Form) ?
(Je clique sur un bouton mais la fonction pour appeller l'autre fenêtre c'est quoi ?)

Merci et bonne prog,
@++

Le créateur du site http://victorlogiciels.com

8 réponses

mortalino Messages postés 6786 Date d'inscription vendredi 16 décembre 2005 Statut Membre Dernière intervention 21 décembre 2011 18
19 juin 2006 à 11:38
Salut,

Tu peux essayer : NomForm.Show

et pour la cacher : NomForm.Hide (ou Unload NomForm)



















@++
<?xml:namespace prefix v ns "urn:schemas-microsoft-com:vml" /?><v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype>


  Mortalino 





Le Mystérieux Chevalier "Provençal, le Gaulois"
N'oubliez pas de lire le 
règlement
3
victorcoasne Messages postés 1101 Date d'inscription jeudi 24 avril 2003 Statut Membre Dernière intervention 23 juillet 2023 7
19 juin 2006 à 11:43
Bonjour,

ça marche : NomForm.Show()


Merci et bonne prog,
@++

Le créateur du site http://victorlogiciels.com
3
victorcoasne Messages postés 1101 Date d'inscription jeudi 24 avril 2003 Statut Membre Dernière intervention 23 juillet 2023 7
19 juin 2006 à 12:06
Bonjour,

C'est bon j'ai trouvé!

Private Sub Ajout_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        Global.WindowsApplication1.Menu.Show()
    End Sub

Merci quand même et bonne prog,
@++

Le créateur du site http://victorlogiciels.com
3
PCPT Messages postés 13272 Date d'inscription lundi 13 décembre 2004 Statut Membre Dernière intervention 3 février 2018 47
19 juin 2006 à 22:53
salut,
menu étant un mot clé, c'est mieux de renommer ta form....

ps Mortalino :  (salut) hide et unload sont totalement différents ! attention donc ;)
++
3

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
mortalino Messages postés 6786 Date d'inscription vendredi 16 décembre 2005 Statut Membre Dernière intervention 21 décembre 2011 18
19 juin 2006 à 11:52
De rien ! (désolé pour l'oubli des (), j'avais pas vu que tu étais en .net)

@++
<?xml:namespace prefix v ns "urn:schemas-microsoft-com:vml" /?><v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype>  Mortalino 

Le Mystérieux Chevalier "Provençal, le Gaulois"
N'oubliez pas de lire le règlement
0
victorcoasne Messages postés 1101 Date d'inscription jeudi 24 avril 2003 Statut Membre Dernière intervention 23 juillet 2023 7
19 juin 2006 à 11:55
Bonjour,

Et si je veux charger la fenêtre principale qui se nomme Menu ?
Car Menu.Show() ne fonctionne pas Menu.GetForm.Show() ne fonctionne pas non plus.

Merci et bonne prog,
@++

Le créateur du site http://victorlogiciels.com
0
mortalino Messages postés 6786 Date d'inscription vendredi 16 décembre 2005 Statut Membre Dernière intervention 21 décembre 2011 18
19 juin 2006 à 11:59
Je pense que c'est dût au fait qu'elle est déjà chargée. Rend ta seconde fenêtre invisible (Hide()) pour revoir ta Form initiale.



















@++
<?xml:namespace prefix v ns "urn:schemas-microsoft-com:vml" /?><v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype>


  Mortalino 





Le Mystérieux Chevalier "Provençal, le Gaulois"
N'oubliez pas de lire le 
règlement
0
victorcoasne Messages postés 1101 Date d'inscription jeudi 24 avril 2003 Statut Membre Dernière intervention 23 juillet 2023 7
19 juin 2006 à 12:02
Bonjour,

En fait je clique sur le bouton
    Private Sub BtnAjout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnAjout.Click
        Ajout.Show()
        Me.Hide()
    End Sub
Ce qui affiche la 2ème fenêtre.
Dès que je ferme la 2ème, la première ne réapparaît pas :
Private Sub Ajout_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        Me.Hide()
    End Sub

Merci et bonne prog,
@++

Le créateur du site http://victorlogiciels.com
0
Rejoignez-nous