Click here to Skip to main content
15,884,917 members
Home / Discussions / C#
   

C#

 
GeneralRe: Text file encoding... Pin
Paul Riley4-Oct-02 7:39
Paul Riley4-Oct-02 7:39 
GeneralRe: Text file encoding... Pin
Luca Leonardo Scorcia4-Oct-02 9:59
professionalLuca Leonardo Scorcia4-Oct-02 9:59 
GeneralRe: Text file encoding... Pin
leppie4-Oct-02 12:36
leppie4-Oct-02 12:36 
GeneralRe: Text file encoding... Pin
Paul Riley4-Oct-02 13:18
Paul Riley4-Oct-02 13:18 
GeneralRe: Text file encoding... Pin
Luca Leonardo Scorcia5-Oct-02 7:07
professionalLuca Leonardo Scorcia5-Oct-02 7:07 
GeneralRe: Text file encoding... Pin
Paul Riley5-Oct-02 7:33
Paul Riley5-Oct-02 7:33 
GeneralAutomatically have a certain tab selected when a tree control node is selected. Pin
Derek Smigelski4-Oct-02 6:23
Derek Smigelski4-Oct-02 6:23 
GeneralMDI application lost focus when GroupBox has button control in it Pin
Zaharang3-Oct-02 20:59
Zaharang3-Oct-02 20:59 
pls help this problem,


As you know, you can't delete minimize/maximize button in MDI child form
even if you set the FormBorder to None.
So I override resize method of childform.
But After that, I can't put button in groupbox of child form 'cuz
application lost focus when child form appears.

Here is very simple example,

Form1.cs<br />
-------------------------------<br />
using System;<br />
using System.Drawing;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Windows.Forms;<br />
using System.Data;<br />
<br />
namespace SimpleTest<br />
{<br />
 public class Form1 : System.Windows.Forms.Form<br />
 {<br />
  private System.Windows.Forms.MainMenu mainMenu1;<br />
  private System.Windows.Forms.MenuItem menuItem1;<br />
  private System.ComponentModel.Container components = null;<br />
<br />
  public Form1()<br />
  {<br />
   InitializeComponent();<br />
  }<br />
  protected override void Dispose( bool disposing )<br />
  {<br />
   if( disposing )<br />
   {<br />
    if (components != null)<br />
    {<br />
     components.Dispose();<br />
    }<br />
   }<br />
   base.Dispose( disposing );<br />
  }<br />
<br />
  private void InitializeComponent()<br />
  {<br />
   this.mainMenu1 = new System.Windows.Forms.MainMenu();<br />
   this.menuItem1 = new System.Windows.Forms.MenuItem();<br />
   this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {<br />
                       this.menuItem1});<br />
   this.menuItem1.Index = 0;<br />
   this.menuItem1.Text = "New Form";<br />
   this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click);<br />
   this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);<br />
   this.ClientSize = new System.Drawing.Size(292, 273);<br />
   this.IsMdiContainer = true;<br />
   this.Menu = this.mainMenu1;<br />
   this.Name = "Form1";<br />
   this.Text = "Form1";<br />
<br />
  }<br />
<br />
  static void Main()<br />
  {<br />
   Application.Run(new Form1());<br />
  }<br />
<br />
  private void menuItem1_Click(object sender, System.EventArgs e)<br />
  {<br />
   Form2 childForm;<br />
<br />
   childForm = new Form2();<br />
   childForm.MdiParent = this;<br />
   childForm.Show();<br />
<br />
  }<br />
 }<br />
}<br />
<br />
<br />
Form2.cs<br />
--------------------------------<br />
using System;<br />
using System.Drawing;<br />
using System.Collections;<br />
using System.ComponentModel;<br />
using System.Windows.Forms;<br />
<br />
namespace SimpleTest<br />
{<br />
 public class Form2 : System.Windows.Forms.Form<br />
 {<br />
  private System.Windows.Forms.GroupBox groupBox1;<br />
  private System.Windows.Forms.Button button1;<br />
  private System.ComponentModel.Container components = null;<br />
<br />
  public Form2()<br />
  {<br />
   InitializeComponent();<br />
  }<br />
<br />
  protected override void Dispose( bool disposing )<br />
  {<br />
   if( disposing )<br />
   {<br />
    if(components != null)<br />
    {<br />
     components.Dispose();<br />
    }<br />
   }<br />
   base.Dispose( disposing );<br />
  }<br />
<br />
  private void InitializeComponent()<br />
  {<br />
   this.groupBox1 = new System.Windows.Forms.GroupBox();<br />
   this.button1 = new System.Windows.Forms.Button();<br />
   this.groupBox1.SuspendLayout();<br />
   this.SuspendLayout();<br />
<br />
   this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {<br />
                     this.button1});<br />
   this.groupBox1.Location = new System.Drawing.Point(64, 64);<br />
   this.groupBox1.Name = "groupBox1";<br />
   this.groupBox1.Size = new System.Drawing.Size(192, 128);<br />
   this.groupBox1.TabIndex = 0;<br />
   this.groupBox1.TabStop = false;<br />
   this.groupBox1.Text = "groupBox1";<br />
<br />
   this.button1.Location = new System.Drawing.Point(40, 40);<br />
   this.button1.Name = "button1";<br />
   this.button1.Size = new System.Drawing.Size(80, 40);<br />
   this.button1.TabIndex = 0;<br />
   this.button1.Text = "button1";<br />
<br />
   this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);<br />
   this.ClientSize = new System.Drawing.Size(292, 273);<br />
   this.ControlBox = false;<br />
   this.Controls.AddRange(new System.Windows.Forms.Control[] {<br />
                    this.groupBox1});<br />
   this.MaximizeBox = false;<br />
   this.MinimizeBox = false;<br />
   this.Name = "Form2";<br />
   this.WindowState = System.Windows.Forms.FormWindowState.Maximized;<br />
   this.Resize += new System.EventHandler(this.Form2_Resize);<br />
   this.groupBox1.ResumeLayout(false);<br />
   this.ResumeLayout(false);<br />
<br />
  }<br />
<br />
  private void Form2_Resize(object sender, System.EventArgs e)<br />
  {<br />
   this.MaximizeBox = false;<br />
   this.WindowState = FormWindowState.Maximized;<br />
  }<br />
 }<br />
}<br />
<br />
-------------------------------


Anyone has same problem with me?
I think this is another bug of MDI in .NET......


- Zaharang
GeneralLegacy dll interoperability problem Pin
Adam Plucinski3-Oct-02 20:20
Adam Plucinski3-Oct-02 20:20 
GeneralRe: Legacy dll interoperability problem Pin
Stephane Rodriguez.3-Oct-02 21:40
Stephane Rodriguez.3-Oct-02 21:40 
GeneralRe: Legacy dll interoperability problem Pin
Adam Plucinski3-Oct-02 22:44
Adam Plucinski3-Oct-02 22:44 
GeneralRe: Legacy dll interoperability problem Pin
Stephane Rodriguez.3-Oct-02 23:20
Stephane Rodriguez.3-Oct-02 23:20 
GeneralRe: Legacy dll interoperability problem Pin
Adam Plucinski3-Oct-02 23:50
Adam Plucinski3-Oct-02 23:50 
GeneralRe: Legacy dll interoperability problem Pin
Stephane Rodriguez.4-Oct-02 0:01
Stephane Rodriguez.4-Oct-02 0:01 
GeneralRe: Legacy dll interoperability problem Pin
Adam Plucinski4-Oct-02 0:37
Adam Plucinski4-Oct-02 0:37 
GeneralRe: Legacy dll interoperability problem Pin
Stephane Rodriguez.4-Oct-02 0:46
Stephane Rodriguez.4-Oct-02 0:46 
QuestionArrayList Problem? Pin
Nick Parker3-Oct-02 18:19
protectorNick Parker3-Oct-02 18:19 
AnswerRe: ArrayList Problem? Pin
Stephane Rodriguez.3-Oct-02 18:40
Stephane Rodriguez.3-Oct-02 18:40 
GeneralRe: ArrayList Problem? Pin
David Stone3-Oct-02 18:50
sitebuilderDavid Stone3-Oct-02 18:50 
GeneralRe: ArrayList Problem? Pin
Nick Parker4-Oct-02 13:01
protectorNick Parker4-Oct-02 13:01 
GeneralRe: ArrayList Problem? Pin
Paul Riley4-Oct-02 13:23
Paul Riley4-Oct-02 13:23 
GeneralStill having problems with IActiveDesktop Pin
Wjousts3-Oct-02 16:38
Wjousts3-Oct-02 16:38 
GeneralRe: Still having problems with IActiveDesktop Pin
David Stone3-Oct-02 16:46
sitebuilderDavid Stone3-Oct-02 16:46 
GeneralRe: Still having problems with IActiveDesktop Pin
Wjousts4-Oct-02 1:54
Wjousts4-Oct-02 1:54 
GeneralRe: Still having problems with IActiveDesktop Pin
David Stone4-Oct-02 10:40
sitebuilderDavid Stone4-Oct-02 10:40 

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.