Click here to Skip to main content
16,009,057 members
Home / Discussions / C#
   

C#

 
GeneralRe: Window Maximize Problem Pin
Amauw Scritz2-May-03 20:14
Amauw Scritz2-May-03 20:14 
Generalref string Pin
Le centriste30-Apr-03 6:00
Le centriste30-Apr-03 6:00 
GeneralRe: ref string Pin
Daniel Turini30-Apr-03 6:38
Daniel Turini30-Apr-03 6:38 
GeneralRe: ref string Pin
Le centriste30-Apr-03 9:13
Le centriste30-Apr-03 9:13 
GeneralMaking a file writable.. Pin
Le centriste30-Apr-03 5:55
Le centriste30-Apr-03 5:55 
GeneralSolved Pin
Le centriste30-Apr-03 9:14
Le centriste30-Apr-03 9:14 
GeneralRe: Solved Pin
kman29-May-03 9:50
kman29-May-03 9:50 
GeneralSerious MDI frusteration Pin
RB@Emphasys30-Apr-03 5:40
RB@Emphasys30-Apr-03 5:40 
Alright,
Heres my question for all of you guru's out there. I have a main form, which is a mdi container. Inside this mdi container, aligned to the left side, is a tree view control with various menu options. When a user selects an option from the treeview control, various "main" forms are loaded, which stretch from the right side of the tree view control onto the rest of the form. Almost as if you had your favorites toolbar open on internet explorer. Now from each main form, you can navigate to a from from this main form. For instance, if the main from displayed various personnel with a datagrid control, you could hit an edit button, and have a form replace the main from with a personnel edit form. So it is possible to navigate forms from the treeview control and the various main forms that the treeview loads. The tricky part is this, I have to beable to implement back and foward buttons for the application, just like in IE. So what Im doing is creating a method of the main, container form.

Something like this
private void HandleForms(Form frmCurrent)
{
try
{
if(frmCurrent != null)
{
if(m_cCurrent != null)
{
m_cCurrent.Close();
}
m_cCurrent = frmCurrent;
m_cCurrent.MdiParent = this;
m_cCurrent.Dock = DockStyle.Right;
//m_cCurrent.SetDelegates(m_dlgNotifyMain)
m_cCurrent.Show();
m_aForms.Add(m_cCurrent); //arraylist of forms for back foward
}
}
catch(Exception e)
{
MessageBox.Show(e.Message, "Error",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}

As you can see, I just simply set a member level form variable equal to
whatever form that the method is passed. I close the previous form and
load the new form. But in order from me to allow the main forms to also
load there own edit forms for example, I need to pass a delegate reference
to those main forms, hence my commented out setdelegate method call. It obviously wont let me use a method call on the generic form class like that. Because the form class could be set equal to any of 10 different forms. Im totally at a loss, here are my main problems

1. If i need to pass a delegate reference to a newly loaded form, and your
not positive at design time which form you need to pass the delegate, how do you accomplish this. I wasnt able to get casting to work, or an interface.

If anyone could help me or point me to a tutorial or something I would greatly appreciate it.

Ryan

GeneralRe: Serious MDI frusteration Pin
Daniel Turini30-Apr-03 5:48
Daniel Turini30-Apr-03 5:48 
GeneralRe: Serious MDI frusteration Pin
RB@Emphasys30-Apr-03 6:41
RB@Emphasys30-Apr-03 6:41 
GeneralRe: Serious MDI frusteration Pin
RB@Emphasys30-Apr-03 8:04
RB@Emphasys30-Apr-03 8:04 
QuestionGetting version number of browser control process? Pin
LongRange.Shooter30-Apr-03 4:29
LongRange.Shooter30-Apr-03 4:29 
AnswerRe: Getting version number of browser control process? Pin
Stephane Rodriguez.30-Apr-03 4:50
Stephane Rodriguez.30-Apr-03 4:50 
GeneralAsserts vs. ArgumentExceptions Pin
Alvaro Mendez30-Apr-03 4:02
Alvaro Mendez30-Apr-03 4:02 
GeneralRe: Asserts vs. ArgumentExceptions Pin
perlmunger30-Apr-03 4:48
perlmunger30-Apr-03 4:48 
GeneralRe: Asserts vs. ArgumentExceptions Pin
Alvaro Mendez30-Apr-03 5:32
Alvaro Mendez30-Apr-03 5:32 
GeneralCasting Pin
apollo-house30-Apr-03 3:02
apollo-house30-Apr-03 3:02 
GeneralRe: Casting Pin
Stephane Rodriguez.30-Apr-03 3:34
Stephane Rodriguez.30-Apr-03 3:34 
GeneralRe: Casting Pin
Nathan Blomquist30-Apr-03 7:43
Nathan Blomquist30-Apr-03 7:43 
GeneralCasting Pin
apollo-house30-Apr-03 3:01
apollo-house30-Apr-03 3:01 
GeneralRichTextBox - tab size Pin
Jucovschi Petru30-Apr-03 2:11
Jucovschi Petru30-Apr-03 2:11 
Generaldates in C# Pin
Andy H29-Apr-03 23:26
Andy H29-Apr-03 23:26 
GeneralRe: dates in C# Pin
ChrisDM30-Apr-03 1:02
ChrisDM30-Apr-03 1:02 
GeneralRe: dates in C# Pin
Andy H30-Apr-03 1:22
Andy H30-Apr-03 1:22 
QuestionAnyone interested in high quality gif article? Pin
BigAndy29-Apr-03 22:59
BigAndy29-Apr-03 22:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.