1

5 つの MDI 子を持つメイン フォームがあります。メイン フォームが作成されると、mdi の子も作成されて表示されます。

画面上で別の場所を割り当てますが、表示されると、デフォルトの場所から始まり、新しい場所に不穏な方法で移動します. フォームを表示する前に場所を割り当てようとしましたが、予想どおり the.Show() を呼び出した後、デフォルトの場所に移動する傾向があります。デフォルトから新しい場所へのこの移動を表示しないようにする方法はありますか?

これがコードフラグメントです

groupSettingsForm.Show();
        groupSettingsForm.Location = new Point(0, 0);
        dsForm.Show();
        dsForm.Location = new Point(groupSettingsForm.Width, 0);
        dPlots.Show();
        dPlots.Location = new Point(groupSettingsForm.Width, dsForm.Height);
        alertsForm.Show();
        alertsForm.Location = new Point(groupSettingsForm.Width, dsForm.Height + dPlots.Height);
        dataValuesForm.Show();
        dataValuesForm.Location = new Point(0, groupSettingsForm.Height);

私はこれを試しましたが、私にはうまくいきませんでした

   groupSettingsForm.Location = new Point(0, 0);
        groupSettingsForm.Show();

        dsForm.Location = new Point(groupSettingsForm.Width, 0);
        dsForm.Show();

        dPlots.Location = new Point(groupSettingsForm.Width, dsForm.Height);
        dPlots.Show();

        alertsForm.Location = new Point(groupSettingsForm.Width, dsForm.Height + dPlots.Height);
        alertsForm.Show();

        dataValuesForm.Location = new Point(0, groupSettingsForm.Height);
        dataValuesForm.Show();
4

1 に答える 1

1

これに似たものがありました-私の質問はここにあります

StartPositionプロパティをFormStartPosition.Manual次のように設定する必要があります。

form.StartPosition = FormStartPosition.Manual;
form.Location = new System.Drawing.Point(0, 0);
于 2009-06-16T09:04:33.693 に答える