|
Hi guys!
I have a question concerning the Timer Elapse Event and the invoked Method.
Is it possible to add an object to the timer which is passed to the Method?
Something like this:
public Timer MouseHooverTimer
{
get
{
if (mouseHooverTimer == null)
{
mouseHooverTimer = new Timer(2000);
mouseHooverTimer.Elapsed += new ElapsedEventHandler(mouseHooverTimer_Elapsed);
}
return mouseHooverTimer;
}
}
private void StartTimer(object information)
{
mouseHooverTimer.Start(); <== HERE ADD THE OBJECT information
}
void mouseHooverTimer_Elapsed(object sender, ElapsedEventArgs e)
{
}
Thanks in advance!
|
|
|
|
|
No, just use a field. Or derive your own timer class that will do it.
|
|
|
|
|
|
Hi,
of course, you can add an object to the timer.
but you must recognize that 'timer Thread' is not the same to 'main Thread',
so after you create the object in 'timer thread',
if you use it in 'main thread', will throw an error.
modified 27-May-14 5:37am.
|
|
|
|
|
I have a field which calculate the total minutes the PC in an internet cafe was used? what's the best field type to use to avoid having the maximam number after few years?
|
|
|
|
|
BigInteger, total minutes?
I probably wouldn't store the value anyway unless it was accessed frequently, which I doubt.
What I would do is have a table containing sessions, with beginning and ending times.
I could then calculate the total elapsed time of all the sessions when needed.
Why do you need it?
|
|
|
|
|
Hello,
I am looking for video editing code information. The requriment is user can edit the video file as well as can take a snapshot.
Please give me some help or any link or site available.
Thanks
Sanyukta
|
|
|
|
|
|
Hi,
video is made up of a lot of pictures.
so if you want to edit the video. Acutally,you can edit pictures.
i remember that Win32Api Provides some functions to create 'avi' format's video, get 'avi' format's video pictures....
or you can use 'Directshow' or 'vfw' to edit video.
|
|
|
|
|
hi i write porgram .porgram me have 3 form. form1 is mdiparent form1,2;time form2 maximize and close; i see form3 maximiz; i no form3 maximize;i what worke?
|
|
|
|
|
Sorry, I am afraid your question does not compile.
Are you saying that when form2 is maximized, form3 is also maximized? And this is not what you want to happen?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Please read this[^]
only two letters away from being an asset
modified on Monday, September 14, 2009 2:09 PM
|
|
|
|
|
That links to this forum, with no selected message. Did you mean this?[^]
|
|
|
|
|
Oops, got the wrong link.
only two letters away from being an asset
|
|
|
|
|
Your question is not very readable, let alone clear. I'm guessing that you have two different MdiChild forms and you want when you maximum one of the children that the other does NOT maximize. If you maximize an MdiChild form, they ALL maximize. You cannot change that behavior.
|
|
|
|
|
hello i m trying to show an image on a crystal report using this code but it does not working
can any body help me ???????????????
<br />
string imagepath="";<br />
DataTable dt = new DataTable();<br />
DataRow drow;<br />
dt.Columns.Add("Image", System.Type.GetType("System.Byte[]"));<br />
drow = dt.NewRow();<br />
FileStream fs = new FileStream(imagepath, FileMode.Open);<br />
BinaryReader br = new BinaryReader(fs);<br />
Byte[] imgbyte = new Byte[fs.Length];<br />
imgbyte = br.ReadBytes(Convert.ToInt32((fs.Length)));<br />
drow[0] = imgbyte;<br />
dt.Rows.Add(drow);<br />
br.Close();<br />
fs.Close();
|
|
|
|
|
i have a tow server one of theme i set the main database and the ather i set the the application the target of the application is to get data from 50 site to main database i can't change this structure
i want to use syncronization service to sync data between main db and 50 site can syncronization service help
|
|
|
|
|
I suggest you post than in the General Databases forum.
|
|
|
|
|
Hi guys,I have a program that starts with a menu form. It will create a new form and remove the menu form after the user pressed a certain button. So I tried the following method :
private void btn2Player_Click(object sender, EventArgs e)
{
frmMenu frmMenu = new frmMenu();
frm2Players frm2P = new frm2Players();
frm2P.Show();
frmMenu.Close();
}
The new form that it is supposed to create shows up but strangely the menu form is still there. What should I do ?
|
|
|
|
|
frmMenu is a new object, you never showed it, so it never closed.
If you want to close the current form you can do the following...
private void btn2Player_Click(object sender, EventArgs e)
{
frm2Players frm2P = new frm2Players();
frm2P.Show();
this.Close();
}
|
|
|
|
|
The menu form did closed but it seems that if the menu form is closed, the new form is closed together with it ... hmm maybe I should try MDI ?
|
|
|
|
|
If I have understood your problem correctly, btn2Player is a Button on your menu form. Would you confirm that that is correct.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Yes. btn2Player calls a new form and after calling the new form, it will remove the old one (menu form)
|
|
|
|
|
As ElliotA has said you are creating a new menu form and closing that, rather than the original one as you intend.
To do what you want, change your code to something like:
private void btn2Player_Click(object sender, EventArgs e)
{
frm2Players frm2P = new frm2Players();
frm2P.Show();
this.Close();
}
However, you said that the menu form is the first form in your application, so if you close it, you will close your whole application, including the new frm2Players that you have just created.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Lim Yuxuan wrote: frmMenu frmMenu = new frmMenu();// menu form
Remove this line since it is not the current instance of menu form.
Lim Yuxuan wrote: frmMenu.Close();//Close the menu form
Replace this line by: this.Hide();
Do not use this.Close() since it will also dispose object frm2P and second form would be closed as well.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
modified on Monday, September 14, 2009 10:07 AM
|
|
|
|