By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,222 Members | 1,079 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,222 IT Pros & Developers. It's quick & easy.

Adding dialog to form

P: n/a
Hi guys,
I am developing a C# application using VS .NET 2003. Its a typical
windows SDI application with a menu and toolbar at the top, treeview on
the left and a status bar at the bottom. In my tree-view, I show a list
of panels, and expanding the panel displays the list of projects for
that panel. in my menu, I have options for the user to add/edit panels
and projects which bring up the appropriate dialogs.

Here is what I am trying to achieve. When the user clicks on a
tree-view on the item (panel or project) I want to show the edit dialog
of the corresponding panel or project on the right hand side. However,
the dialog should be immovable, and should remain fixed to the right
hand side. What I don't know is how to add one form (the edit dialog of
the panel or project) to another form (the child window of the SDI
application) and keep it fixed to one location. Is it even possible?

Thanks in advance.

Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
The solution is that managing your editable content in user control.
for example
1. create user controls
public class ProjectUserControl: System.Windows.Forms.UserControl {
//encapsulate all functionalities in this user control
}

2. in the sdi main form
public class MainForm : System.Windows.Forms.Form {

TreeView treeView = new TreeView();
//this is the place to display the editable content
Panel contentPanel = new Panel();

protected void SelectNode(object sender, TreeViewEventArgs e) {
contentPanel.Controls.Clear();
contentPanel.Controls.Add(new ProjectUserControl());
}

}

Thats it, just a bit of creating and adding user control at run time.

hope this helps

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.