Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    [c# 2005] form mdi

    ciao

    sapete comne si genera una mdi application con .net 2005 utilizzano c# come linguaggio???

    Ho inserito nel mio progetto un formMDIparent!
    tutto ok, fin qui...
    ora come faccio ad inserire i figli???

  2. #2
    Crei una nuova form e prima di fare lo show, indichi nella proprieta MDIParent il puntatore alla tua Form principale.

  3. #3
    se faccio come dici tu:

    child.MDIParent = this

    il debugger mi dice che non esiste la proprietà mdiparent per l'oggetto a cui cerco di assegnarla.

    ..l'oggetto è una window form...

  4. #4
    Il Codice !!!!
    codice:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    
    namespace WindowsApplication1
    {
        public class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private Button button1;
            /// <summary>
            /// Required designer variable.
            /// </summary>
            private System.ComponentModel.IContainer components = null;
    
            /// <summary>
            /// Clean up any resources being used.
            /// </summary>
            /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
            protected override void Dispose(bool disposing)
            {
                if (disposing && (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(12, 12);
                this.button1.Name = "button1";
                this.button1.Size = new System.Drawing.Size(75, 23);
                this.button1.TabIndex = 0;
                this.button1.Text = "button1";
                this.button1.UseVisualStyleBackColor = true;
                this.button1.Click += new System.EventHandler(this.button1_Click);
                // 
                // Form1
                // 
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.ClientSize = new System.Drawing.Size(292, 266);
                this.Controls.Add(this.button1);
                this.IsMdiContainer = true; 
                this.Name = "Form1";
                this.Text = "Form1";
                this.ResumeLayout(false);
            }
    
            #endregion
    
            private void button1_Click(object sender, EventArgs e)
            {
                Form ChildForm = new Form();
                ChildForm.MdiParent = this;
                ChildForm.Show(); 
    
            }
        }
    }

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.