473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Windows forms

Hi all,

I'm working in C#. I have 3 forms. On the 1st form I have a single "NEXT" button. In its click event I'm hiding the currently active form (1st), creating an instance of the 2nd form and showing it.

On the next 2 forms, apart from the next button (who's click events are similar to that of the 1st form's next button), I have "BACK" buttons. In these buttons I want to show the previously hidden forms. How do I do it?


Please help


Amey
Jun 20 '07 #1
3 1170
kenobewan
4,871 Expert 4TB
Have them call that page. If you want the previous values still in the form then you will have to store them. HTH.
Jun 20 '07 #2
Hi all,

I'm working in C#. I have 3 forms. On the 1st form I have a single "NEXT" button. In its click event I'm hiding the currently active form (1st), creating an instance of the 2nd form and showing it.

On the next 2 forms, apart from the next button (who's click events are similar to that of the 1st form's next button), I have "BACK" buttons. In these buttons I want to show the previously hidden forms. How do I do it?


Please help


Amey
[Reply = Rajaprakash]

Hi,

In the first Form's button click event, set the 1st Form enabled property as false then create the instance of the 2nd form and showing it and pass the 1st form using write a method in 2nd form which parameter set as object

In 2nd Form's "Back" button event, close the 2nd Form then set the 1st Form's enabled property as True.

For Example,Form1 have "Next" Button and Form2 have "Back" Button.

Form1

1.Write the code in Form1 Next button click event.

private void btnNext_Click(object sender, EventArgs e)
{
Form1.ActiveForm.Enabled = false;
Form2 frmObj = new Form2();
frmObj.Show();
frmObj.ActveForm(this);
}



Form2

1. Declare the Form1 in Form2 class.
2. Write a method in Form2 and assign the Form1 in the local form.
3. Wirte the code in Form2 Back button click event.

private Form1 frmFirst;

public void ActveForm(Object recForm)
{
frmFirst= (Form1)recForm;

}

private void btnBack_Click(object sender, EventArgs e)
{
this.Close();
frmFirst.Enabled = true;

}

Can you try this. It'll work.

Rajaprakash

[/Reply]
Jul 5 '07 #3
Can you try this code. It will helpful to you
Jul 5 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Greg Bacchus | last post by:
Hi, I'm getting an exception that really has me stumped. It's sporadic at best, it's only happened a handful of times. This particular time it happened when the user pressed 'Alt-S' to save the...
15
by: Wiktor Zychla | last post by:
today we've found a critical issue regarding the ListView from Windows.Forms. it was confirmed on several machines with Win2K and XP. here's the problem: create a ListView with about 50000 rows....
5
by: david | last post by:
I have developed my web service with a domain name of my computer name and wwwroot directory. I also developed a client of windows form application. It works locally (i.e. in the same machine). ...
7
by: Tyler Foreman | last post by:
Hello, I have a strange problem that occurs every so often in my application. It usually takes place when I hide one form and activate another. What happens is I get the following exception:...
1
by: Scott Davies | last post by:
Hi, I'm looking for some help on a small program that I'm trying to develop in VB.NET. I'm having trouble getting the code that I've written to work, can anyone shed some light as to where I'm...
0
by: Scott Davies | last post by:
Hi, I'm looking for some help on a small program that I'm trying to develop in VB.NET. The program I'm trying to develop needs to be able to do the following: - Select remote server -...
4
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps...
4
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
1
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I...
21
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.