473,405 Members | 2,334 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,405 software developers and data experts.

WinForm state

Sometimes I will minimize my main form on the task bar and right click to
close the application.
How do I know if the previous form state is minimized when I start my
application next time?

private void MainForm_FormClosed(object sender, FormClosedEventArgs e)

{

Settings.Default.AdminFormWidth = this.Width;

Settings.Default.AdminFormHeight = this.Height;

Settings.Default.AdminFormLeft = this.Left;

Settings.Default.AdminFormTop = this.Top;

Settings.Default.Save();

}

private void MainForm_Load(object sender, EventArgs e)

{

}
Oct 12 '06 #1
1 1914
Hi,
Do you want to run only one instance?

There are several ways of doing it.

You could also use the Process.GetProcesses() to iterate in the processes
running

You could then send a message to the other instance of your process that
return the status of the main window

--
Ignacio Machin
machin AT laceupsolutions.com

"Alan T" <al*************@yahoo.com.auwrote in message
news:OU**************@TK2MSFTNGP04.phx.gbl...
Sometimes I will minimize my main form on the task bar and right click to
close the application.
How do I know if the previous form state is minimized when I start my
application next time?

private void MainForm_FormClosed(object sender, FormClosedEventArgs e)

{

Settings.Default.AdminFormWidth = this.Width;

Settings.Default.AdminFormHeight = this.Height;

Settings.Default.AdminFormLeft = this.Left;

Settings.Default.AdminFormTop = this.Top;

Settings.Default.Save();

}

private void MainForm_Load(object sender, EventArgs e)

{

}


Oct 12 '06 #2

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

Similar topics

3
by: jdionne | last post by:
I have a WInform app that runs a DTS. When I developed it on the SQL box and executed it, it ran fine. I used the Trusted connection parameter for the DTS. I don't want to use passwords. I...
5
by: Sunny | last post by:
Hi, If I have (hmm, at least I want to have :) ) a winform, displaying the progress of a long duration method, which is running in a separate thread, how do I implement canceling the thread, if I...
3
by: Tom | last post by:
hi friends. I'm still unfamiliar with winform does it have a session or application storage that allows session to be passed from one form to the next ? thanks Tom
3
by: Mrinal Kamboj | last post by:
Hi , I am doing some experimentation , so i created a winform exe , that on load event creates a NotifyIcon object for System Tray Icon . Now if i run that application normally by VS.net or...
3
by: Lucas Tam | last post by:
Is there a way to write to IIS' Application or Session variables from a Winforms application? I am trying to share application state between a web application and a desktop app. Remoting would...
5
by: Brian Hu | last post by:
Hi I am new to vb.net and trying to build a VB.net winform application. I really like the new look of buttons, readio buttons etc. on my WinXP box. But only thing is I cannot make it consistent...
2
by: Kevin Yu | last post by:
hi all got a questoin here, I have a winform client to call web service and the web service functions have EnableSession =ture, use IE to test the web service session, it works, but how to get...
4
by: randy1200 | last post by:
I have a WinForm class that has accumulated a tremendous amount of logic code. Can anyone point me toward a good article on factoring logic code out of a WinForm class? Thanks, -- Randy
6
by: randy1200 | last post by:
I'm using Visual Studio 2005 and C#. I need to print a WinForm used for data entry as a graphic. In other words, I need to print the exact WinForm the user sees on the screen. I searched through...
0
by: yao | last post by:
there are two web method in my web service. bool verifyUser(string user, string pwd) DataSet GetData() that I need connect the web service by WinForm, I hope the client is verified by server by...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
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
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.