Не удается изменить размер элементов управления с помощью мыши в Visual Studio 2008 (C#, .NET Compact)

Я разрабатываю приложение Windows Forms для Windows Mobile 6 в Visual Studio 2008. В каждой форме требуется наличие некоторых общих элементов управления, таких как логотип (PictureBox), заголовок (метка) и небольшое описание (также метка). Я решил создать FormBase с этими элементами управления и наследовать другие формы от этой базы.

Проблема в том, что по какой-то причине, когда я помещаю кнопку или другой элемент управления в эту унаследованную форму, я не могу изменить ее размер с помощью мыши. Я могу нажать Shift+Стрелка, чтобы изменить размер чего угодно с помощью сочетаний клавиш, но мышь не работает.

Это не очень удобно ни мне, ни другим разработчикам в моей команде.

Какие-либо предложения?

Обновление 1

базовая форма:

public class FormBase : Form
{
    public FormBase()
    {
        InitializeComponent();
    }


    /// <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()
    {
        System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormBase));
        this.pictureLogo = new System.Windows.Forms.PictureBox();
        this.labelTitle = new System.Windows.Forms.Label();
        this.panelSeparator = new System.Windows.Forms.Panel();
        this.SuspendLayout();
        // 
        // pictureLogo
        // 
        this.pictureLogo.Image = ((System.Drawing.Image)(resources.GetObject("pictureLogo.Image")));
        this.pictureLogo.Location = new System.Drawing.Point(0, 0);
        this.pictureLogo.Name = "pictureLogo";
        this.pictureLogo.Size = new System.Drawing.Size(48, 48);
        // 
        // labelTitle
        // 
        this.labelTitle.Font = new System.Drawing.Font("Tahoma", 10F, System.Drawing.FontStyle.Bold);
        this.labelTitle.ForeColor = System.Drawing.Color.Black;
        this.labelTitle.Location = new System.Drawing.Point(54, 2);
        this.labelTitle.Name = "labelTitle";
        this.labelTitle.Size = new System.Drawing.Size(183, 16);
        this.labelTitle.Text = "Title";
        // 
        // panelSeparator
        // 
        this.panelSeparator.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                    | System.Windows.Forms.AnchorStyles.Right)));
        this.panelSeparator.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(44)))), ((int)(((byte)(75)))));
        this.panelSeparator.Location = new System.Drawing.Point(3, 50);
        this.panelSeparator.Name = "panelSeparator";
        this.panelSeparator.Size = new System.Drawing.Size(234, 1);
        // 
        // FormBase
        // 
        this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
        this.AutoScroll = true;
        this.BackColor = System.Drawing.Color.White;
        this.ClientSize = new System.Drawing.Size(240, 320);
        this.ControlBox = false;
        this.Controls.Add(this.panelSeparator);
        this.Controls.Add(this.labelTitle);
        this.Controls.Add(this.pictureLogo);
        this.ForeColor = System.Drawing.Color.Black;
        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
        this.KeyPreview = true;
        this.Location = new System.Drawing.Point(0, 0);
        this.MinimizeBox = false;
        this.Name = "FormBase";
        this.Text = "FormBase";
        this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
        this.ResumeLayout(false);

    }

    #endregion

    private System.Windows.Forms.PictureBox pictureLogo;
    private System.Windows.Forms.Label labelTitle;
    private System.Windows.Forms.Panel panelSeparator;
}

наследственная форма:

public class FrontDoorForm : FormBase
{
    public FrontDoorForm()
    {
        InitializeComponent();
    }

    private void buttonQuit_Click(object sender, EventArgs e)
    {
        Close();
    }

    /// <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.buttonQuit = new System.Windows.Forms.Button();
        this.SuspendLayout();
        // 
        // buttonQuit
        // 
        this.buttonQuit.Location = new System.Drawing.Point(3, 54);
        this.buttonQuit.Name = "buttonQuit";
        this.buttonQuit.Size = new System.Drawing.Size(115, 46);
        this.buttonQuit.TabIndex = 2;
        this.buttonQuit.Text = "Quit";
        this.buttonQuit.Click += new System.EventHandler(this.buttonQuit_Click);
        // 
        // FrontDoorForm
        // 
        this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
        this.BackColor = System.Drawing.Color.White;
        this.ClientSize = new System.Drawing.Size(240, 320);
        this.Controls.Add(this.buttonQuit);
        this.Font = new System.Drawing.Font("Tahoma", 10F, System.Drawing.FontStyle.Regular);
        this.ForeColor = System.Drawing.Color.Black;
        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
        this.Location = new System.Drawing.Point(0, 0);
        this.MinimizeBox = true;
        this.Name = "FrontDoorForm";
        this.Text = "FrontDoorForm";
        this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
        this.Controls.SetChildIndex(this.buttonQuit, 0);
        this.ResumeLayout(false);

    }

    #endregion

    private System.Windows.Forms.Button buttonQuit;
}

person Dmitri Trofimov    schedule 03.09.2014    source источник
comment
Не видя кода, все, что я могу сказать, это может быть потому, что ваша производная форма заставляет Initialze.. не вызываться.   -  person Ryan Mann    schedule 03.09.2014
comment
попробуйте эту SO публикацию и посмотрите, поможет ли она stackoverflow.com/questions/15092025/   -  person MethodMan    schedule 03.09.2014
comment
@Ryios InitializeComponent вызывается как в базовом конструкторе, так и в конструкторе унаследованного класса (во время выполнения), хотя метода Initialize нет.   -  person Dmitri Trofimov    schedule 03.09.2014
comment
Я воспроизвел. Не совсем уверен, что вызывает это, давайте назовем это ошибкой. Измените WindowState базовой формы обратно на Normal для обходного пути. Вы все еще можете получить его Максимизированным в производной форме.   -  person Hans Passant    schedule 03.09.2014
comment
@HansPassant Вау! Это действительно сработало! Спасибо!   -  person Dmitri Trofimov    schedule 03.09.2014


Ответы (1)


Чтобы закрыть вопрос, я процитирую ответ из комментарий:

Измените WindowState базовой формы обратно на Normal для обходного пути. Вы все еще можете получить его Максимизированным в производной форме. Ханс Пассант

person Dmitri Trofimov    schedule 24.09.2014