|
yeah..I have tried that approach, but as u say, i was not able to to open up any other window until i closed this one..but tht should not happen in an MDI windows application ..right ?
Can Dispose() method help in this case?
|
|
|
|
|
yeah..I have tried that approach, but as u say, i was not able to to open up any other window until i closed this one..but tht should not happen in an MDI windows application ..right ?
Can Dispose() method help in this case?
|
|
|
|
|
MDI Parent forms contain a collection of it's children (this.MdiChildren). Before you open a new instance of a form you could check this collection if your form exist and simply activate this instance.
|
|
|
|
|
Can you elaborate a bit more...thanks
|
|
|
|
|
I found the solutions mate:
Form2 frm = new Form2();
if (MdiChildren.Length != 0)
{
for (int i = 0; i < this.MdiChildren.Length; i++)
{
if (this.MdiChildren[i].GetType().Name != "Form2")
{
frm.Show();
frm.MdiParent = this;
}
}
}
else
{
frm.Show();
frm.MdiParent = this;
}
PS: you will have to modify this the above is real quick and dirty.
You will have to check this for each and every form you open.
Cheers.
|
|
|
|
|
Can you fire an event inside of an event that is already executing?
|
|
|
|
|
|
Is there anything special you have to do to get this to work because the event inside the executing event is not firing?
|
|
|
|
|
It is possible that you are not firing the event properly, can you pass me the code.
|
|
|
|
|
This is the code:
protected void btnNext_Clicked(object sender, EventArgs e)
{
switch (m_teststage)
{
case "STEP1":
hidMode.Value = "STEP2";
break;
case "STEP2":
hidMode.Value = "STEP3";
break;
}
m_teststage = hidMode.Value;
FormatPageChange();
}
private void FormatPageChange()
{
if (m_teststage == "STEP2") InitialiseDMRGrid();
if (m_teststage == "STEP3") InitialiseTestGrid();
SetPanelVisibility();
SetButtonVisibility();
SetValidatorsEnabled();
}
private void InitialiseDMRGrid()
{
WebGridHelper m_webgridhelperDMR = new WebGridHelper(wgDMR, "", "ID");
wgDMR.PrepareDataBinding += new DataSourceEventHandler(wgDMR_PrepareDataBinding);
wgDMR.InitializeDataSource += new DataSourceEventHandler(wgDMR_InitializeDataSource);
m_webgridhelperDMR.SortColumns += new SortColumnsEventHandler(m_webgridhelperDMR_SortColumns);
wgDMR.InitializePostBack += new PostBackEventHandler(wgDMR_InitializePostBack);
}
If I click the Next button the event fires but when it gets to the InitialiseDMRGrid method it goes in but does not fire the events inside.
|
|
|
|
|
I think the problem is:
You are "adding" the events on button click and not "firing" them. They will fire when they are suppose to fire.
Your code will add the events to, for eg:
wgDMR.InitializeDataSource += new DataSourceEventHandler(wgDMR_InitializeDataSource);
and when the DataSource in initialised then this event will fire. (I guess you have defined the event handlers somewhere else, because I can't see the event handlers for any of the above events.)
|
|
|
|
|
I see what I am doing wrong now. Thanks for your help.
|
|
|
|
|
This is not good approach by firing an event inside the already firing event.
Regards,
Satips.
|
|
|
|
|
Why not?
only two letters away from being an asset
|
|
|
|
|
Satips wrote: This is not good approach by firing an event inside the already firing event.
WHY ?
|
|
|
|
|
hello every body.
is there any method to write a matlab code within c#?
Please help.
|
|
|
|
|
There is an Article by Emanuele Ruffaldi Here[^] in CP.
Hope it will help you.
Regards,
Satips.
|
|
|
|
|
Hi
Can anyone help me with some function I can use to help me get the mouse over coord in a logical window.
samuel
Programming helps one to forget the world around them
|
|
|
|
|
Hey Experts
I have used a lot of time finding the best solution on how to build a widget, like the one from Yahoo widget engine in C#.
The problem is the transparent look, where for example the background can be round and with a drop shadow. I have tried a few tutorial, but they result in a lot of aliasing.
The result i would like is like the picture on the following link:
http://widgets.yahoo.com/gallery/view.php?widget=40459[^]
I totally new to C#, but can I already loves it, so I hope somebody can produce me a little sample application.
I hope somebody can help me
|
|
|
|
|
Not sure what you want here - to create web controls, windows controls, or what ? I presume you have a background in other programming languages ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
No I just want to transform the widget to C#-language instead of using the widget engine. I have just made a background with dropshadow in photoshop. I want this no be the background and on top i will place some windows komponents. I have uploaded the picture on http://www.control.aau.dk/~ksno04-nobackup/background.png[^]
Was that a bit more clear?
|
|
|
|
|
|
Hi, there!
I have two related tables in a DataSet and I want to fill a DataGridView with data from both tables.
Could anybody tell me an easy way to do it?
Thank you, in advance.
--
Adrián Córdoba
|
|
|
|
|
1. You can create a third table and insert the required data in that table and then bind the datasource to that table.
2. Or you can write a store procedure which will just get those data and return select.
|
|
|
|
|
You can create a third data table (dt3) at runtime in the same dataset (ds), populate it with the fields from the two data tables(dt1 and dt2) and then finally bind this data table with the grid view using its data source property as shown below (but this solution is effective only if there will be same number and type of fields everytime you create and populate a new data table):
dataGridView1.DataSource=ds.Tables["dt3"];
This should solve your problem
|
|
|
|