private void UserViewPanelInitialize() { this.userViewPanel = new Panel(); this.userViewPanel.BackColor = Color.FromArgb(0, 0, 80); this.userViewPanel.Width = this.Width - 4; this.userViewPanel.Location = new Point(2, 2); this.AddIconsToUserView(); userProfilePictureLabel = new Label(); userProfilePictureLabel.Image = this.ResizedProfileImage; userProfilePictureLabel.Location = new Point((this.userViewPanel.Width - userProfilePictureLabel.Image.Width) / 2, userViewIcons[0].Bottom + 20); userProfilePictureLabel.Size = userProfilePictureLabel.Image.Size; userProfilePictureLabel.MouseHover += delegate(Object sender, EventArgs e) { userProfilePictureLabel.Image = GraphicsStudio.Overlap(userProfilePictureLabel.Image, new Bitmap(FileResources.Picture("pictureChangeHint.png"), userProfilePictureLabel.Image.Size)); }; userProfilePictureLabel.MouseLeave += delegate(Object sender, EventArgs e) { userProfilePictureLabel.Image = this.ResizedProfileImage; }; userProfilePictureLabel.MouseDoubleClick += delegate(Object sender, MouseEventArgs e) { ((SlidebarPanel)this.parent).ChangeProfilePicture(); }; this.userViewPanel.Controls.Add(userProfilePictureLabel); fullnameTextBox = new TextBox(); fullnameTextBox.Text = this.UserProfileName; fullnameTextBox.Font = CustomFonts.SmallBold; fullnameTextBox.Height = fullnameTextBox.PreferredHeight; fullnameTextBox.TextAlign = HorizontalAlignment.Center; fullnameTextBox.Width = this.Width * 3 / 4; fullnameTextBox.BackColor = Color.FromArgb(userViewPanel.BackColor.R + 50, userViewPanel.BackColor.G + 50, userViewPanel.BackColor.B + 50); fullnameTextBox.Location = new Point((this.userViewPanel.Width - fullnameTextBox.Width) / 2, userProfilePictureLabel.Bottom + 20); fullnameTextBox.ForeColor = Color.FromArgb(240, 240, 240); this.userViewPanel.Controls.Add(fullnameTextBox); dragengerUsernameTextBox = new TextBox(); dragengerUsernameTextBox.Text = "@" + User.LoggedIn.Username; dragengerUsernameTextBox.ReadOnly = true; dragengerUsernameTextBox.Font = CustomFonts.New(13.0f, 'i'); dragengerUsernameTextBox.Width = fullnameTextBox.Width; dragengerUsernameTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; dragengerUsernameTextBox.TextAlign = HorizontalAlignment.Center; dragengerUsernameTextBox.BackColor = Color.FromArgb(userViewPanel.BackColor.R + 20, userViewPanel.BackColor.G + 20, userViewPanel.BackColor.B + 20); dragengerUsernameTextBox.Location = new Point((this.userViewPanel.Width - dragengerUsernameTextBox.Width) / 2, fullnameTextBox.Bottom + 5); dragengerUsernameTextBox.ForeColor = Color.FromArgb(240, 240, 240); this.userViewPanel.Controls.Add(dragengerUsernameTextBox); this.userViewPanel.Height = this.userViewPanel.PreferredSize.Height + 20; this.Controls.Add(this.userViewPanel); }
private void UserViewPanelInitialize() { this.userViewPanel = new Panel(); this.userViewPanel.BackColor = Color.FromArgb(0, 0, 80); this.userViewPanel.Width = this.Width - 4; this.userViewPanel.Location = new Point(2, 2); this.AddIconsToUserView(); userProfilePictureLabel = new Label(); userProfilePictureLabel.Image = this.ResizedProfileImage; userProfilePictureLabel.Location = new Point((this.userViewPanel.Width - userProfilePictureLabel.Image.Width) / 2, userViewIcons[0].Bottom + 20); userProfilePictureLabel.Size = userProfilePictureLabel.Image.Size; userProfilePictureLabel.MouseHover += delegate(Object sender, EventArgs e) { userProfilePictureLabel.Image = GraphicsStudio.Overlap(userProfilePictureLabel.Image, new Bitmap(FileResources.Picture("pictureChangeHint.png"), userProfilePictureLabel.Image.Size)); }; userProfilePictureLabel.MouseLeave += delegate(Object sender, EventArgs e) { userProfilePictureLabel.Image = this.ResizedProfileImage; }; userProfilePictureLabel.MouseDoubleClick += delegate(Object sender, MouseEventArgs e) { this.ChangeProfilePicture(); }; this.userViewPanel.Controls.Add(userProfilePictureLabel); userFUllNameLabel = new Label(); userFUllNameLabel.Text = this.UserProfileName; userFUllNameLabel.Font = CustomFonts.SmallBold; userFUllNameLabel.Size = userFUllNameLabel.PreferredSize; userFUllNameLabel.Location = new Point((this.userViewPanel.Width - userFUllNameLabel.Width) / 2, userProfilePictureLabel.Bottom + 20); userFUllNameLabel.ForeColor = Color.FromArgb(240, 240, 240); this.userViewPanel.Controls.Add(userFUllNameLabel); Label dragengerEmailLabel = new Label(); dragengerEmailLabel.Text = this.FetchDragengerEmail; dragengerEmailLabel.Font = CustomFonts.New(12.0f, 'i'); dragengerEmailLabel.Size = dragengerEmailLabel.PreferredSize; dragengerEmailLabel.Location = new Point((this.userViewPanel.Width - dragengerEmailLabel.Width) / 2, userFUllNameLabel.Bottom + 5); dragengerEmailLabel.ForeColor = Color.FromArgb(240, 240, 240); this.userViewPanel.Controls.Add(dragengerEmailLabel); this.userViewPanel.Height = this.userViewPanel.PreferredSize.Height + 20; this.mainPanelInSidebar.Controls.Add(this.userViewPanel); }