Calling Forms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aalsheikh
    New Member
    • Feb 2008
    • 1

    Calling Forms

    I wanna jump from form to another..
    the activated for (Form1) and when I press a button (X)... i need this action to call another form (Form2) in the same project.


    How I can do that???

    Regards,
    Audai
  • daniel aristidou
    Contributor
    • Aug 2007
    • 494

    #2
    Originally posted by aalsheikh
    I wanna jump from form to another..
    the activated for (Form1) and when I press a button (X)... i need this action to call another form (Form2) in the same project.


    How I can do that???

    Regards,
    Audai
    use the form closing of formclosed events (newer versions of vb..)
    Then change the setting of the application to close when last form closes

    Comment

    • gobblegob
      New Member
      • Dec 2007
      • 133

      #3
      Try this mate,

      Private Sub Form_KeyDown(Ke yCode As Integer, Shift As Integer)
      If KeyCode = vbKeyX Then
      Form2.Show
      End If
      End Sub


      Make sure you set form1 properties the KeyPreview = True

      Gobble.
      Last edited by gobblegob; Feb 24 '08, 02:06 PM. Reason: Forgot to mention keyPreview...

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by aalsheikh
        I wanna jump from form to another..
        the activated for (Form1) and when I press a button (X)... i need this action to call another form (Form2) in the same project.
        I'd like a little more detail, to clarify the situation. For instance...
        • What version of VB are you using?
        • By "press a button" are you referring to pressing a key on the keyboard, or clicking on a command button with the mousepointer?
        • Which parts are giving you trouble? The basic details of how to attach code to an event? How to show a form? Something else?

        Comment

        Working...