|
i have an MDI child (MDI1) form which I am opening another MDI child (MDI2) from that form. How can I check if MDI1 was ctivated after closing MDI to refresh it? do I have to use Enter or Activated events?
|
|
|
|
|
use
this.ActiveMdiChild
It will return the MDI child form that is currently active. If you want to activate another form just use
frm2.focus();
|
|
|
|
|
I don't want to focus it.
well, let me explain it more..
MDI2 is an edit form of MDI1 so MDI is just viewing the data where MDI2 is the edit.
when the user clicks on the edit button (on MDI1) it will open MDI2.
when the user click save (on MDI2) it will close MDI2..
now I want to know if any data were changed and refresh the data on MDI accordainaly.
|
|
|
|
|
Well, Do the refresh of data when form is activated. Write the code inside Form_Activated to refresh the form with new data.
Dont forget to set a flag when edit is done and recheck the flag within form_Activated . Otherwise the data will be refreshed every time you activate the form.
|
|
|
|
|
Create a bool on MDI2, set it to true if data is edited.
Create a readonly property for this bool on MDI2 and check it from MDI1.
Refresh if true.
Regards
Mick Curley
|
|
|
|
|
of course, you should use these event.
for example, use 'closing event ' to check if MDI1 was activted.
or you can use WINAPI ('FindWindow')to Find out that 'WinForm', and then check if it was actived.
modified 27-May-14 5:31am.
|
|
|
|
|
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 ?
|
|
|
|