ictoan

Hello,

Is there a way that I can move from form to form similiar to the way you click on a link on websites What I mean is that each time the user click on a button, it opens a new form because I'm using Show() or ShowDialog(). But what I would like is, for example, if a user hits the Next button, then the next form will show up in the same position as the first form and the first form will be closed. Kind of like going from one webpage to another by clicking a link under the same browser window.

Hm. Relating to this.. what does FlowLayoutPanel do Will it allow me to flow from one sets of Controls to another If so, then I can just put everything on one Form, right

Thanks



Re: Visual Basic Express Edition Moving/Flowing from form to form

js06

Flow of forms and a flow layout panel are 2 different things.

You can control the flow of your forms being shown with code and events and a flowlayoutpanel will align contols like buttons, etc... in a nice flowing grid pattern on a single form.

so that being said you need to track which form is showing and determine which form will be next

i don't know the best way to do this but one way is to use a variable that stores the name of the form being shown and then use a if then statement to determine which form is showing and which one will be next based on that.

I would have to think about it some more but i would think there might be an easier way. someone probably has something for this.

anyway this should help get you started






Re: Visual Basic Express Edition Moving/Flowing from form to form

Solitaire

This code will replace the next form in the same starting location as the previous form, even if you move the form to another location. This example uses two forms and switches between them. The first is placed in Form1, the second is placed in Form2, but you can use similar code for as many forms as you need.

Code Block

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim myloca As System.Drawing.Point

myloca = Me.Location

Form2.Show()

Form2.Location = myloca

Me.Hide()

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim myloca As System.Drawing.Point

myloca = Me.Location

Form1.Show()

Form1.Location = myloca

Me.Hide()

End Sub