473,765 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Back and Forward.

Hi, guys.
My application requires functionalities like back and
forward navigating button on winforms. And there are
many forms linking each other. Each form has a pair of
buttons of "Back" and "Forward "How can I implement the
back and forward procedure to make them work ?

Is there anyone has the same experience like that ?

Thanks
Nov 20 '05 #1
8 6524
"Tracey" <jo********@hot mail.com> wrote in news:0a5001c383 b6$60bad790
$a*******@phx.g bl:
Hi, guys.
My application requires functionalities like back and
forward navigating button on winforms. And there are
many forms linking each other. Each form has a pair of
buttons of "Back" and "Forward "How can I implement the
back and forward procedure to make them work ?

Is there anyone has the same experience like that ?


I have a template form which has the forward/back button, and items that
are global for all pages. I have a User control for each "page" with the
appropriate layout. I swap the User control when the user presses
forward/backward.

As for storing options, I have a class object in the template form that
stores the pertinent options for each page. The object is passed into the
constructor of the user controls. The user control populates the selected
options if the user is viewing a previous page. I'm still working on this
part though.

If anyone has done this before, I would like to know how you did it as
well. Thanks!

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 20 '05 #2
Hello,

"Tracey" <jo********@hot mail.com> schrieb:
My application requires functionalities like back and
forward navigating button on winforms. And there are
many forms linking each other. Each form has a pair of
buttons of "Back" and "Forward "How can I implement the
back and forward procedure to make them work ?


You can create multiple usercontrols, one for each page, and show only the
active page. Maybe you can provide more details on where to navigate
forward and backward.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #3
Navigation of forms can be very easily and effectively achieved creating a
Navigator Class that maintains the navigation path and also keeps track of
the current form. When the user clicks on forward or backward, you just call
the Navigator's Next/Previous methods.

"Lucas Tam" <RE********@rog ers.com> wrote in message
news:Xn******** *************** ****@140.99.99. 130...
"Tracey" <jo********@hot mail.com> wrote in news:0a5001c383 b6$60bad790
$a*******@phx.g bl:
Hi, guys.
My application requires functionalities like back and
forward navigating button on winforms. And there are
many forms linking each other. Each form has a pair of
buttons of "Back" and "Forward "How can I implement the
back and forward procedure to make them work ?

Is there anyone has the same experience like that ?


I have a template form which has the forward/back button, and items that
are global for all pages. I have a User control for each "page" with the
appropriate layout. I swap the User control when the user presses
forward/backward.

As for storing options, I have a class object in the template form that
stores the pertinent options for each page. The object is passed into the
constructor of the user controls. The user control populates the selected
options if the user is viewing a previous page. I'm still working on this
part though.

If anyone has done this before, I would like to know how you did it as
well. Thanks!

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 20 '05 #4
Navigation of forms can be very easily and effectively achieved creating a
Navigator Class that maintains the navigation path and also keeps track of
the current form. When the user clicks on forward or backward, you just call
the Navigator's Next/Previous methods.
"Lucas Tam" <RE********@rog ers.com> wrote in message
news:Xn******** *************** ****@140.99.99. 130...
"Tracey" <jo********@hot mail.com> wrote in news:0a5001c383 b6$60bad790
$a*******@phx.g bl:
Hi, guys.
My application requires functionalities like back and
forward navigating button on winforms. And there are
many forms linking each other. Each form has a pair of
buttons of "Back" and "Forward "How can I implement the
back and forward procedure to make them work ?

Is there anyone has the same experience like that ?


I have a template form which has the forward/back button, and items that
are global for all pages. I have a User control for each "page" with the
appropriate layout. I swap the User control when the user presses
forward/backward.

As for storing options, I have a class object in the template form that
stores the pertinent options for each page. The object is passed into the
constructor of the user controls. The user control populates the selected
options if the user is viewing a previous page. I'm still working on this
part though.

If anyone has done this before, I would like to know how you did it as
well. Thanks!

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Nov 20 '05 #5
Hello,

"Tracey" <jo********@hot mail.com> schrieb:
My application requires functionalities like back and
forward navigating button on winforms. And there are
many forms linking each other. Each form has a pair of
buttons of "Back" and "Forward "How can I implement the
back and forward procedure to make them work ?


You can create multiple usercontrols, one for each page, and show only the
active page. Maybe you can provide more details on where to navigate
forward and backward.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #6
Tracey,

I have navigation(Firs t,Previous,Next ,Last) and command
buttons(Add,Upd ate,Delete,Clos e) on a MDI Parent that control the actions of
the MDI children.

First I use a "Generic" form

Public Class A
Inherits System.Windows. Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeCompo nent()

'Add any initialization after the InitializeCompo nent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
components = New System.Componen tModel.Containe r
End Sub

Public Overridable WriteOnly Property Navigate()
Set(ByVal Value)
Select Case Value
Case "Print"
Case "First"
Case "Previous"
Case "Next"
Case "Last"
Case "Add"
Case "Update"
Case "Delete"
Case "Close"
Case "Save"
End Select
End Set
End Property

#End Region

End Class

Then I derive all my MDI children from the above class.

Public Class frmRate
Inherits A

THE FOLLOWING PROPERTY IS USED BY MDI PARENT TO SEND COMMAND FROM TOOLBAR TO
CHILDREN

Public Overrides WriteOnly Property Navigate()
Set(ByVal Value)
Select Case Value
Case "Print"
Case "First"
Me.BindingConte xt(dsDataSet, "Ratefil").Posi tion =
Me.BindingConte xt(dsDataSet).P osition.MinValu e
Case "Previous"
Me.BindingConte xt(dsDataSet, "Ratefil").Posi tion -= 1
Case "Next"
Me.BindingConte xt(dsDataSet, "Ratefil").Posi tion += 1
Case "Last"
Me.BindingConte xt(dsDataSet, "Ratefil").Posi tion =
Me.BindingConte xt(dsDataSet).P osition.MaxValu e
Case "Add"
btAdd_Click("", System.EventArg s.Empty)
Case "Update"
btUpdate_Click( "", System.EventArg s.Empty)
Case "Delete"
btDelete_Click( "", System.EventArg s.Empty)
Case "Close"
End Select
End Set
End Property

In my MDI Parent this Sub is used to send messages to the MDI Children.

Private Sub ToolBar1_Button Click(ByVal sender As System.Object, ByVal e
As System.Windows. Forms.ToolBarBu ttonClickEventA rgs) Handles
ToolBar1.Button Click
Try
Dim activeChild As Form = Me.ActiveMdiChi ld
If ActForm <> -1 Then
DirectCast(acti veChild, A).Navigate =
e.Button.Text.T oString
End If
Catch ex As Exception
MessageBox.Show (ex.Source.ToSt ring & " - " & ex.Message,
Application.Pro ductName, _
MessageBoxButto ns.OK, MessageBoxIcon. Error)
End Try
End Sub

Hope this help. If this works thank Herfried he helped me with
ToolBar1_Button Click and "Generic" form code.

Ken
Nov 20 '05 #7
Thanks for your advice.
THe winforms in my application already have button
controls on each form, say "Back" and "Forward".

My winform have multiple links to other forms. And link
in other forms will also link to this form.

did I provide enough information ?
-----Original Message-----
Hello,

"Tracey" <jo********@hot mail.com> schrieb:
My application requires functionalities like back and
forward navigating button on winforms. And there are
many forms linking each other. Each form has a pair of
buttons of "Back" and "Forward "How can I implement the
back and forward procedure to make them work ?
You can create multiple usercontrols, one for each page,

and show only theactive page. Maybe you can provide more details on where to navigateforward and backward.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
.

Nov 20 '05 #8
Thanks, Ken.
But my application is not a MDI Form application.

I got something useful from your code.
Thanks again!

-----Original Message-----
Tracey,

I have navigation(Firs t,Previous,Next ,Last) and command
buttons(Add,Up date,Delete,Clo se) on a MDI Parent that control the actions ofthe MDI children.

First I use a "Generic" form

Public Class A
Inherits System.Windows. Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer. InitializeCompo nent()

'Add any initialization after the InitializeCompo nent() call
End Sub

'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then
If Not (components Is Nothing) Then
components.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er
'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor.
<System.Diagnos tics.DebuggerSt epThrough()> Private SubInitializeComp onent()
components = New System.Componen tModel.Containe r
End Sub

Public Overridable WriteOnly Property Navigate()
Set(ByVal Value)
Select Case Value
Case "Print"
Case "First"
Case "Previous"
Case "Next"
Case "Last"
Case "Add"
Case "Update"
Case "Delete"
Case "Close"
Case "Save"
End Select
End Set
End Property

#End Region

End Class

Then I derive all my MDI children from the above class.

Public Class frmRate
Inherits A

THE FOLLOWING PROPERTY IS USED BY MDI PARENT TO SEND COMMAND FROM TOOLBAR TOCHILDREN

Public Overrides WriteOnly Property Navigate()
Set(ByVal Value)
Select Case Value
Case "Print"
Case "First"
Me.BindingConte xt (dsDataSet, "Ratefil").Posi tion =Me.BindingCont ext(dsDataSet). Position.MinVal ue
Case "Previous"
Me.BindingConte xt (dsDataSet, "Ratefil").Posi tion -= 1 Case "Next"
Me.BindingConte xt (dsDataSet, "Ratefil").Posi tion += 1 Case "Last"
Me.BindingConte xt (dsDataSet, "Ratefil").Posi tion =Me.BindingCont ext(dsDataSet). Position.MaxVal ue
Case "Add"
btAdd_Click("", System.EventArg s.Empty) Case "Update"
btUpdate_Click( "", System.EventArg s.Empty) Case "Delete"
btDelete_Click( "", System.EventArg s.Empty) Case "Close"
End Select
End Set
End Property

In my MDI Parent this Sub is used to send messages to the MDI Children.
Private Sub ToolBar1_Button Click(ByVal sender As System.Object, ByVal eAs System.Windows. Forms.ToolBarBu ttonClickEventA rgs) HandlesToolBar1.Butto nClick
Try
Dim activeChild As Form = Me.ActiveMdiChi ld
If ActForm <> -1 Then
DirectCast(acti veChild, A).Navigate =
e.Button.Text. ToString
End If
Catch ex As Exception
MessageBox.Show (ex.Source.ToSt ring & " - " & ex.Message,Application.Pr oductName, _
MessageBoxButto ns.OK, MessageBoxIcon. Error) End Try
End Sub

Hope this help. If this works thank Herfried he helped me withToolBar1_Butto nClick and "Generic" form code.

Ken
.

Nov 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
11074
by: Bud Zielinski | last post by:
Can someone point me to a script that will allow me to implement a "back button" in an HTA, since there is no history for HTA's. Understand this requires an array, is there any sample code out there ? thanks Bud
3
2765
by: Nick Tew | last post by:
Hi, Firstly, any help would be gratefully received. Im using several iframes on a single page and would like individual 'back' and 'forward' buttons located in each of the iframes which only relate to the information inside the iframe. Ive managed to put 'back' and 'forward' buttons on each of the iframe's by using:
3
1805
by: pmelanso | last post by:
hello, I want to create back and forward buttons on my web page. I didn't have a problem with that... the thing I am having trouble with is I woudl like to display "disabled" images when there if there isn't a page to go back/forward...how would I go about doing that??? Pam
10
8882
by: pmelanso | last post by:
Hello, How can I tell if there is a page to go back to in the history or not??? Same with forward??? say something like/// if (there is a page to go back to ) { // DO something }else { }
5
3070
by: Ma³y Piotruœ | last post by:
Hello, (Sorry for my english.) I am new to HTML/JavaScript/CSS. I would like to ask for help with such a problem: I need to create a href link working like "back" button (I know this is not recommended by it's not my idea, and I must respect this requirement.) I did it this way: <a href="javascript:history.back()">Back</a>
5
1740
by: Brad | last post by:
I created a base page class which sets a response filter and the filter injects additional html into the response output stream. The filter works fine and everything works as expected except for the following quirk: When I navigate my browser to another url (a link in the page, a browser favorite...it doesn't mater) and then use the browsers (IE 6) Back or Forward buttons to go back to my filtered page the additional html I had added...
1
6016
by: Terry Olsen | last post by:
Is there any way to disable the client browser "Back" and "Forward" buttons while on my site? Or how would I go about knowing that a page hit is caused by a back/forward navigation? I have discovered that my web app is definately NOT Back/Forward safe. It's really messing with my SQL data bigtime. Thanks.
4
6280
by: John | last post by:
Hi everybody, for my web-application (it must currently work only under IE6) I have a servlet that intercepts user's HTTP GET requests for a typical search result page, which contains a paging mechanismus for navigating between the result pages (e.g. << 1 2 3 4 5 ... >). When the user clicks on this navigation, the JSP send a GET request to a servlet wich does some buisiness logic - in particular it logs (with log4j) how many times an...
1
1599
by: annir | last post by:
Hi Guys, I used VB.net 2005. In my project I used Drivelistbox, Dirlistbox and Filelistbox so that I can access the drives that I have. I have these problem about the back and forward button, I don't have any idea on how to do it. To make my problem clearer: Example, the first path of the Dirlistbox was C:\My documents, then as the user wants to open their files inside. The path goes C:\My documents\MyFile then again open other file, ...
0
9399
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9957
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8832
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.