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

Start a job

In my program, if the user click on the backupbutton a second dialog
appears. How to start the job automatticly. I think in form_Activated like
this:

Code Blockpublic

frmUpload()
{

InitializeComponent();

}

private void frmUpload_Activated(object sender, EventArgs e)

{

\\ Start the job here
}

private void btnAnnuleer_Click(object sender, EventArgs e)

{

this.Close();

}

or is there another way to accomplish this.

Rinaldo

Nov 4 '07 #1
6 1650
why dont you use the frm_Load event ? maybe I dont understand your question.

"Rinaldo" wrote:
In my program, if the user click on the backupbutton a second dialog
appears. How to start the job automatticly. I think in form_Activated like
this:

Code Blockpublic

frmUpload()
{

InitializeComponent();

}

private void frmUpload_Activated(object sender, EventArgs e)

{

\\ Start the job here
}

private void btnAnnuleer_Click(object sender, EventArgs e)

{

this.Close();

}

or is there another way to accomplish this.

Rinaldo
Nov 4 '07 #2
Rinaldo,

What do you mean by start a job? Are you looking to call another
component or start another program? Either way, if that component/program
presents a dialog to the user, you have to tell that program/component to
not do so. If it's not an option, then there is little you can do without
resorting to unsupported techniques (reflection on private properties,
sending windows messages to the dialog, etc, etc).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Rinaldo" <zw*************@hotmail.com.nospamwrote in message
news:70**********************************@microsof t.com...
In my program, if the user click on the backupbutton a second dialog
appears. How to start the job automatticly. I think in form_Activated like
this:

Code Blockpublic

frmUpload()
{

InitializeComponent();

}

private void frmUpload_Activated(object sender, EventArgs e)

{

\\ Start the job here
}

private void btnAnnuleer_Click(object sender, EventArgs e)

{

this.Close();

}

or is there another way to accomplish this.

Rinaldo
Nov 4 '07 #3
Hi Nicholas,

What I mean is: if I call a second form I don't want to wait for a user
event to click a button (Start for example) but start some routines
inmiddiatly and show the outgoing messages on the second form.

On the second form there is a cancel button so the user can interrupt the
operation.

I hope I be cleare now (I'm not english or american, so it is difficult to
explain what i mean)

Rinaldo

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comschreef
in bericht news:AF**********************************@microsof t.com...
Rinaldo,

What do you mean by start a job? Are you looking to call another
component or start another program? Either way, if that component/program
presents a dialog to the user, you have to tell that program/component to
not do so. If it's not an option, then there is little you can do without
resorting to unsupported techniques (reflection on private properties,
sending windows messages to the dialog, etc, etc).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Rinaldo" <zw*************@hotmail.com.nospamwrote in message
news:70**********************************@microsof t.com...
>In my program, if the user click on the backupbutton a second dialog
appears. How to start the job automatticly. I think in form_Activated
like this:

Code Blockpublic

frmUpload()
{

InitializeComponent();

}

private void frmUpload_Activated(object sender, EventArgs e)

{

\\ Start the job here
}

private void btnAnnuleer_Click(object sender, EventArgs e)

{

this.Close();

}

or is there another way to accomplish this.

Rinaldo

Nov 4 '07 #4
In the load event the second form is not show yet. I want to wait that the
second form is displayed so I can write some information to it.

See my next message to Nicholas....
"Rogelio" <Ro*****@discussions.microsoft.comschreef in bericht
news:67**********************************@microsof t.com...
why dont you use the frm_Load event ? maybe I dont understand your
question.

"Rinaldo" wrote:
>In my program, if the user click on the backupbutton a second dialog
appears. How to start the job automatticly. I think in form_Activated
like
this:

Code Blockpublic

frmUpload()
{

InitializeComponent();

}

private void frmUpload_Activated(object sender, EventArgs e)

{

\\ Start the job here
}

private void btnAnnuleer_Click(object sender, EventArgs e)

{

this.Close();

}

or is there another way to accomplish this.

Rinaldo
Nov 4 '07 #5
On 2007-11-04 09:19:31 -0800, "Rinaldo"
<zw*************@hotmail.com.nospamsaid:
What I mean is: if I call a second form I don't want to wait for a user
event to click a button (Start for example) but start some routines
inmiddiatly and show the outgoing messages on the second form.
Assuming that you already have a single method that you _could_ call
when the user clicks a button (i.e. "Start for example", as you wrote),
then you can simply call that method in the same place you show the
second form, or in the second form's initialization (for example,
override the OnLoad() method and call that single method there).

Which place is best would depend somewhat on the exact nature of the
processing you're trying to start. Generally speaking though, I'd say
that if the processing is to be started _every time_ you create and
show this second form, and the processing is in some way closely tied
to the second form, then putting in the OnLoad() override the call to
the method to start the processing would be best.

Pete

Nov 4 '07 #6
Thanx Pete, it helped me to the right way.......

"Peter Duniho" <Np*********@NnOwSlPiAnMk.comschreef in bericht
news:2007110410173016807-NpOeStPeAdM@NnOwSlPiAnMkcom...
On 2007-11-04 09:19:31 -0800, "Rinaldo"
<zw*************@hotmail.com.nospamsaid:
>What I mean is: if I call a second form I don't want to wait for a user
event to click a button (Start for example) but start some routines
inmiddiatly and show the outgoing messages on the second form.

Assuming that you already have a single method that you _could_ call when
the user clicks a button (i.e. "Start for example", as you wrote), then
you can simply call that method in the same place you show the second
form, or in the second form's initialization (for example, override the
OnLoad() method and call that single method there).

Which place is best would depend somewhat on the exact nature of the
processing you're trying to start. Generally speaking though, I'd say
that if the processing is to be started _every time_ you create and show
this second form, and the processing is in some way closely tied to the
second form, then putting in the OnLoad() override the call to the method
to start the processing would be best.

Pete
Nov 4 '07 #7

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

Similar topics

16
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
8
by: Challenge | last post by:
Hi, I got error, SQL1768N Unable to start HADR. Reason code = "7", when I tried to start hadr primary database. Here are the hadr configuration of my primary db: HADR database role ...
4
by: carson | last post by:
I have written two windows services: - service A does some crunching of local data files and uploads them to a central processing computer via http. - service B monitors a manifest file on a...
2
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I have an exe application that I want to start remotely.Once I start the application, I want to press ok to that application. To start the application, I did...
0
by: Vinod Sadanandan | last post by:
Fast-Start Failover An Overview In Dataguard Environment ============================================================================= This article describes the automatic fast start failover...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.