public newAccountForm(AccountDataGrid adg)
        {
            this.ClientSize = new Size(150, 300);

            adg_ = adg;

            accountnamelabel     = new Label();
            accounttypelabel     = new Label();
            accountusernamelabel = new Label();
            accountpasswordlabel = new Label();
            accounthostlabel     = new Label();
            accountportlabel     = new Label();

            accountname     = new TextBox();
            accounttype     = new ComboBox();
            accountusername = new TextBox();
            accountpassword = new TextBox();
            accounthost     = new TextBox();
            accountport     = new TextBox();

            AddAccount    = new Button();
            CancelAccount = new Button();

            accountnamelabel.Text     = "Name:";
            accountnamelabel.Location = new Point(20, 12);
            accountnamelabel.AutoSize = true;

            accounttypelabel.Text     = "Account Type:";
            accounttypelabel.Location = new Point(20, 55);
            accounttypelabel.AutoSize = true;

            accountusernamelabel.Text     = "Username:"******"Password:"******"Host:";
            accounthostlabel.Location = new Point(20, 175);
            accounthostlabel.AutoSize = true;

            accountportlabel.Text     = "Port:";
            accountportlabel.Location = new Point(20, 215);
            accountportlabel.AutoSize = true;

            accountname.Size     = new Size(110, 20);
            accountname.Location = new Point(20, 30);

            accounttype.Size     = new Size(110, 20);
            accounttype.Location = new Point(20, 70);
            accounttype.Items.Add("Account");
            accounttype.Items.Add("Anonymous");
            accounttype.SelectedItem  = accounttype.Items[0];
            accounttype.DropDownStyle = ComboBoxStyle.DropDownList;
            accounttype.FlatStyle     = FlatStyle.Flat;
            accounttype.BackColor     = Color.White;

            accountusername.Size      = new Size(110, 20);
            accountusername.Location  = new Point(20, 110);
            accountusername.BackColor = Color.White;

            accountpassword.Size      = new Size(110, 20);
            accountpassword.Location  = new Point(20, 150);
            accountpassword.BackColor = Color.White;

            accounthost.Size     = new Size(110, 20);
            accounthost.Location = new Point(20, 190);

            accountport.Size     = new Size(110, 20);
            accountport.Location = new Point(20, 230);

            AddAccount.Text     = "Add";
            AddAccount.Size     = new Size(70, 20);
            AddAccount.Location = new Point(5, 270);

            CancelAccount.Text     = "Cancel";
            CancelAccount.Size     = new Size(70, 20);
            CancelAccount.Location = new Point(75, 270);

            this.Controls.Add(accountnamelabel);
            this.Controls.Add(accounttypelabel);
            this.Controls.Add(accountusernamelabel);
            this.Controls.Add(accountpasswordlabel);
            this.Controls.Add(accounthostlabel);
            this.Controls.Add(accountportlabel);

            this.Controls.Add(accountname);
            this.Controls.Add(accounttype);
            this.Controls.Add(accountusername);
            this.Controls.Add(accountpassword);
            this.Controls.Add(accounthost);
            this.Controls.Add(accountport);

            this.Controls.Add(AddAccount);
            this.Controls.Add(CancelAccount);

            accounttype.SelectedIndexChanged += new EventHandler(accounttype_SelectedIndexChanged);
            AddAccount.Click    += new EventHandler(AddAccount_Click);
            CancelAccount.Click += new EventHandler(CancelAccount_Click);
            InitializeComponent();
        }
示例#2
0
        public Accountform(Form1 f1)
        {
            this.ClientSize = new Size(500, 400);

            F1 = f1;
            changebuttons[0] = new Button();
            changebuttons[1] = new Button();
            changebuttons[2] = new Button();
            createnew        = new Button();
            cancel           = new Button();
            accountsdisplay  = new Label();
            update_textbox   = new TextBox();


            adg = new AccountDataGrid(changebuttons, this.ClientSize);

            changebuttons[0].Text     = "Delete";
            changebuttons[0].AutoSize = true;
            changebuttons[0].Location = new Point(10, 20);
            changebuttons[0].Enabled  = false;

            changebuttons[1].Text     = "Update";
            changebuttons[1].AutoSize = true;
            changebuttons[1].Location = new Point(10, 120);
            changebuttons[1].Enabled  = false;

            createnew.Text     = "Create";
            createnew.AutoSize = true;
            createnew.Location = new Point(380, 20);

            cancel.Text     = "Cancel";
            cancel.AutoSize = true;
            cancel.Location = new Point(250, this.ClientSize.Height - cancel.Height);

            changebuttons[2].Text     = "Connect";
            changebuttons[2].AutoSize = true;
            changebuttons[2].Location = new Point(170, this.ClientSize.Height - changebuttons[2].Height);
            changebuttons[2].Enabled  = false;

            accountsdisplay.Text     = "Server Accounts:";
            accountsdisplay.Location = new Point(this.ClientSize.Width / 2 - 50, 130);
            accountsdisplay.AutoSize = true;

            update_textbox.Size     = new Size(70, changebuttons[1].Size.Height);
            update_textbox.Location = new Point(90, 122);

            changebuttons[0].Click += new EventHandler(delete_Click);
            changebuttons[1].Click += new EventHandler(update_Click);
            createnew.Click        += new EventHandler(createnew_Click);
            cancel.Click           += new EventHandler(cancel_Click);
            changebuttons[2].Click += new EventHandler(connect_Click);

            this.Controls.Add(adg.returngridview);
            this.Controls.Add(changebuttons[0]);
            this.Controls.Add(changebuttons[1]);
            this.Controls.Add(createnew);
            this.Controls.Add(cancel);
            this.Controls.Add(changebuttons[2]);
            this.Controls.Add(accountsdisplay);
            this.Controls.Add(update_textbox);
            InitializeComponent();
        }