Click here to Skip to main content
15,914,070 members
Home / Discussions / C#
   

C#

 
GeneralRe: Int32 type alias problem! Pin
leppie8-Jan-07 3:33
leppie8-Jan-07 3:33 
Questionusing SqlDataReader Pin
swjam7-Jan-07 14:22
swjam7-Jan-07 14:22 
AnswerRe: using SqlDataReader Pin
Rama Krishna Vavilala7-Jan-07 14:31
Rama Krishna Vavilala7-Jan-07 14:31 
QuestionHow to persist datareader Pin
AndrusM7-Jan-07 12:31
AndrusM7-Jan-07 12:31 
AnswerRe: How to persist datareader Pin
Guffa7-Jan-07 14:15
Guffa7-Jan-07 14:15 
AnswerRe: How to persist datareader Pin
karam chandrabose7-Jan-07 16:21
karam chandrabose7-Jan-07 16:21 
AnswerRe: How to persist datareader Pin
sno-19-Jan-07 3:31
sno-19-Jan-07 3:31 
QuestionRemoving MenuStrip from MDI child Pin
AndrusM7-Jan-07 12:29
AndrusM7-Jan-07 12:29 
I found issue in .NET 2 where MenuStrip is not removed from MDI child window.

How to fix this ?

Andrus.

To reproduce:

1. Run the code
2. Select File / open

Observed: child window contains MenuStrip with File menu item.

Expected: child window should not contain MenuStrip

Code to reproduce the issue:

---- program.cs:

using System.Windows.Forms;
using WindowsApplication1;
static class Program {
static void Main() {
Application.Run(new Form1());
}
}

--- form1.cs

using System.Windows.Forms;
using System;

namespace WindowsApplication1 {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}

private void openToolStripMenuItem_Click(object sender, EventArgs e) {
Form2 newMDIChild = new Form2();
newMDIChild.MdiParent = this;
newMDIChild.Show();

}
}
}

----- form1.designer.cs

namespace WindowsApplication1 {
partial class Form1 {
private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}

#region Windows Form Designer generated code
private void InitializeComponent() {
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(292, 24);
this.menuStrip1.TabIndex = 1;
this.menuStrip1.Text = "menuStrip1";
//
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.openToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20);
this.fileToolStripMenuItem.Text = "&File";
//
// openToolStripMenuItem
//
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.openToolStripMenuItem.Text = "&open";
this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.Add(this.menuStrip1);
this.IsMdiContainer = true;
this.MainMenuStrip = this.menuStrip1;
this.Name = "Form1";
this.Text = "Form1";
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();

}

#endregion

private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
}
}

-------- form2.designer.cs

namespace WindowsApplication1 {
partial class Form2 {
private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}

#region Windows Form Designer generated code

private void InitializeComponent() {
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(292, 24);
this.menuStrip1.TabIndex = 0;
this.menuStrip1.Text = "menuStrip1";
//
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.saveToolStripMenuItem});
this.fileToolStripMenuItem.MergeAction = System.Windows.Forms.MergeAction.MatchOnly;
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20);
this.fileToolStripMenuItem.Text = "&File";
//
// saveToolStripMenuItem
//
this.saveToolStripMenuItem.MergeAction = System.Windows.Forms.MergeAction.Insert;
this.saveToolStripMenuItem.MergeIndex = 3;
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.saveToolStripMenuItem.Text = "Save";
//
// Form2
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
this.Name = "Form2";
this.Text = "Form2";
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();

}

#endregion

private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
}
}


-------- form2.cs

using System.Windows.Forms;

namespace WindowsApplication1 {
public partial class Form2 : Form {
public Form2() {
InitializeComponent();
}
}
}

Andrus

QuestionIs it possible to share Session Variables across multiple threads? Pin
travich7-Jan-07 9:19
travich7-Jan-07 9:19 
AnswerRe: Is it possible to share Session Variables across multiple threads? Pin
Christian Graus7-Jan-07 9:30
protectorChristian Graus7-Jan-07 9:30 
GeneralRe: Is it possible to share Session Variables across multiple threads? Pin
travich7-Jan-07 9:34
travich7-Jan-07 9:34 
GeneralRe: Is it possible to share Session Variables across multiple threads? Pin
Christian Graus7-Jan-07 9:38
protectorChristian Graus7-Jan-07 9:38 
GeneralRe: Is it possible to share Session Variables across multiple threads? Pin
Guffa7-Jan-07 12:04
Guffa7-Jan-07 12:04 
GeneralRe: Is it possible to share Session Variables across multiple threads? Pin
Christian Graus7-Jan-07 12:12
protectorChristian Graus7-Jan-07 12:12 
GeneralRe: Is it possible to share Session Variables across multiple threads? Pin
Guffa7-Jan-07 12:47
Guffa7-Jan-07 12:47 
AnswerRe: Is it possible to share Session Variables across multiple threads? Pin
Guffa7-Jan-07 12:02
Guffa7-Jan-07 12:02 
QuestionMFC to C#, form changing Pin
muharrem7-Jan-07 9:07
muharrem7-Jan-07 9:07 
AnswerRe: MFC to C#, form changing [modified] Pin
Mircea Puiu7-Jan-07 20:50
Mircea Puiu7-Jan-07 20:50 
QuestionTextBox problem Pin
CodeItWell7-Jan-07 8:34
CodeItWell7-Jan-07 8:34 
AnswerRe: TextBox problem Pin
Ed.Poore7-Jan-07 8:36
Ed.Poore7-Jan-07 8:36 
AnswerRe: TextBox problem Pin
tgrt7-Jan-07 15:46
tgrt7-Jan-07 15:46 
AnswerRe: TextBox problem Pin
Tyler457-Jan-07 18:23
Tyler457-Jan-07 18:23 
GeneralRe: TextBox problem Pin
Martin#7-Jan-07 19:51
Martin#7-Jan-07 19:51 
GeneralRe: TextBox problem Pin
CodeItWell8-Jan-07 0:52
CodeItWell8-Jan-07 0:52 
GeneralRe: TextBox problem Pin
Martin#8-Jan-07 1:08
Martin#8-Jan-07 1:08 

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.