Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralRe: Creating identical tabs Pin
Heath Stewart13-Feb-04 20:15
protectorHeath Stewart13-Feb-04 20:15 
GeneralRe: Creating identical tabs Pin
noahfields14-Feb-04 11:49
noahfields14-Feb-04 11:49 
GeneralRe: Creating identical tabs Pin
noahfields14-Feb-04 14:31
noahfields14-Feb-04 14:31 
QuestionInput Box and Label Null Value? Pin
Eric Houser13-Feb-04 18:09
Eric Houser13-Feb-04 18:09 
AnswerRe: Input Box and Label Null Value? Pin
Mazdak13-Feb-04 19:17
Mazdak13-Feb-04 19:17 
GeneralRe: Input Box and Label Null Value? Pin
Heath Stewart13-Feb-04 20:12
protectorHeath Stewart13-Feb-04 20:12 
GeneralRe: Input Box and Label Null Value? Pin
Mazdak13-Feb-04 20:18
Mazdak13-Feb-04 20:18 
GeneralA child-parent problem... Pin
cemlouis13-Feb-04 13:26
cemlouis13-Feb-04 13:26 
Hi to all,

I have 3 dialogs which are Parent, Dialog and Child. When I press My Parent dialog's menu I come across with my dialog box. Everything ok for now. But when I press the button on dialog I want my child dialog inside the parent dlg box. I think I made something wrong the code runs without any errors but doesn't make what I want??? Might be a logic failure in somewhere. This trashed all my day (I brainstrom and checked lots of articles about forms...) But couldn't get a result. So any help would be greatly appreciated. I am posting all my 3 file(Sorry for the pollution)

Thank you,
Cem Louis

/////////////
//Parent.cs//
/////////////

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace Test1
{
/// <summary>
/// Summary description for Parent.
/// </summary>
public class Parent : System.Windows.Forms.Form
{
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;

public Parent()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1});
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem2});
this.menuItem1.Text = "Show Dialog";
//
// menuItem2
//
this.menuItem2.Index = 0;
this.menuItem2.Text = "Show!";
this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
//
// Parent
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
this.IsMdiContainer = true;
this.Menu = this.mainMenu1;
this.Name = "Parent";
this.Text = "Parent";

}
#endregion

/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Parent());
}

private void menuItem2_Click(object sender, System.EventArgs e)
{
Test1.Dialog Dialog = new Test1.Dialog();
Dialog.Show();
}
}
}

/////////////
//Dialog.cs//
/////////////

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace Test1
{
/// <summary>
/// Summary description for Dialog.
/// </summary>
public class Dialog : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;

public Dialog()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(104, 104);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "Show Child";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Dialog
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.button1});
this.Name = "Dialog";
this.Text = "Dialog";
this.ResumeLayout(false);

}
#endregion

private void button1_Click(object sender, System.EventArgs e)
{
Test1.Child chform = new Test1.Child();

Test1.Parent Parent = new Test1.Parent();

chform.MdiParent = Parent;

chform.Show();
}
}
}

////////////
//Child.cs//
////////////

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace Test1
{
/// <summary>
/// Summary description for Child.
/// </summary>
public class Child : System.Windows.Forms.Form
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;

public Child()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.Size = new System.Drawing.Size(300,300);
this.Text = "Child";
}
#endregion
}
}

GeneralRe: A child-parent problem... Pin
Bill Dean13-Feb-04 15:39
Bill Dean13-Feb-04 15:39 
GeneralRe: A child-parent problem... Pin
Kentamanos13-Feb-04 15:55
Kentamanos13-Feb-04 15:55 
GeneralRe: A child-parent problem... Pin
cemlouis14-Feb-04 2:08
cemlouis14-Feb-04 2:08 
GeneralE-mail Validation to clean-up mailing lists Pin
blakeb_113-Feb-04 11:09
blakeb_113-Feb-04 11:09 
GeneralRe: E-mail Validation to clean-up mailing lists Pin
Kentamanos13-Feb-04 12:00
Kentamanos13-Feb-04 12:00 
GeneralRe: E-mail Validation to clean-up mailing lists Pin
Heath Stewart13-Feb-04 12:48
protectorHeath Stewart13-Feb-04 12:48 
GeneralRe: E-mail Validation to clean-up mailing lists Pin
Kentamanos13-Feb-04 13:11
Kentamanos13-Feb-04 13:11 
GeneralRe: E-mail Validation to clean-up mailing lists Pin
blakeb_116-Feb-04 11:18
blakeb_116-Feb-04 11:18 
GeneralRe: E-mail Validation to clean-up mailing lists Pin
Heath Stewart16-Feb-04 11:34
protectorHeath Stewart16-Feb-04 11:34 
GeneralRe: E-mail Validation to clean-up mailing lists Pin
Troy G14-Feb-04 7:34
Troy G14-Feb-04 7:34 
GeneralRe: E-mail Validation to clean-up mailing lists Pin
blakeb_116-Feb-04 8:05
blakeb_116-Feb-04 8:05 
GeneralRe: E-mail Validation to clean-up mailing lists Pin
blakeb_116-Feb-04 9:22
blakeb_116-Feb-04 9:22 
GeneralRe: E-mail Validation to clean-up mailing lists Pin
Member 187126812-Oct-05 18:12
Member 187126812-Oct-05 18:12 
QuestionTransparency killed by task mgr? Pin
Joe Pardue13-Feb-04 10:24
Joe Pardue13-Feb-04 10:24 
AnswerRe: Transparency killed by task mgr? Pin
leppie13-Feb-04 19:08
leppie13-Feb-04 19:08 
GeneralRe: Transparency killed by task mgr? Pin
joepardue14-Feb-04 5:57
joepardue14-Feb-04 5:57 
GeneralInherited form validation issues Pin
RB@Emphasys13-Feb-04 10:23
RB@Emphasys13-Feb-04 10:23 

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.