Вопрос по c# – C # позиционирование окна

6

Error: User Rate Limit Exceeded

public Form1()
{
    InitializeComponent();

    this.Top = 0;
    this.Left = 0;
}

Error: User Rate Limit Exceeded

public Form1()
{
    InitializeComponent();

    IntPtr hwnd = this.Handle;
    this.Top = 0;
    this.Left = 0;
}

Error: User Rate Limit Exceeded

The value of the Handle property is a Windows HWND. If the handle has not yet been created, referencing this property will force the handle to be created.

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded Fremen
Error: User Rate Limit Exceeded Abed Hawa
Error: User Rate Limit ExceededOnHandleCreatedError: User Rate Limit Exceededthis.HandleError: User Rate Limit Exceededthis.HandleError: User Rate Limit Exceeded C.Evenhuis

Ваш Ответ

4   ответа
2

Error: User Rate Limit ExceededHandleError: User Rate Limit Exceeded

this.Location = new Point(0, 0); // or any value to set the location
5

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit ExceededStartupPosition = ManualError: User Rate Limit Exceeded
Error: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit Exceeded

Error: User Rate Limit Exceededthis.Handle. (I suppose that referencing that property you are forcing the windows manager to build immediatly the form using the designer values in StartupPosition)

Error: User Rate Limit Exceeded Fremen
4
public Form1()
{
    InitializeComponent();
    Load += Form1_Load;
}

void Form1_Load(object sender, EventArgs e)
{
    Location = new Point(700, 20);
}

Error: User Rate Limit Exceeded

public Form1()
{
    InitializeComponent();
    StartPosition = FormStartPosition.Manual;
    Location = new Point(700, 20);
}
3

Error: User Rate Limit Exceeded

using System;
using System.Windows.Forms;

namespace PositioningCs
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            /*
            IntPtr h = this.Handle;
            this.Top = 0;
            this.Left = 0;
            */
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.Top = 0;
            this.Left = 0;
        }
    }
}

Похожие вопросы