Example #1
0
        private void FrmSelectAvatar_Load(object sender, EventArgs e)
        {
            var files = RSCApplication.GetAllAvatarFiles();

            for (int i = 0; i < files.Count; i++)
            {
                var file   = files[i];
                var avatar = new PictureBox();
                avatar.Width                 = 42;
                avatar.Height                = 42;
                avatar.BackgroundImage       = Image.FromFile(file);
                avatar.BackgroundImageLayout = ImageLayout.Stretch;
                avatar.Tag               = file;
                avatar.Margin            = new Padding(10, 5, 10, 5);
                avatar.MouseEnter       += new EventHandler(avatar_MouseEnter);
                avatar.MouseLeave       += new EventHandler(avatar_MouseLeave);
                avatar.MouseDoubleClick += new MouseEventHandler(avatar_MouseDoubleClick);
                this.flowLayoutPanel1.Controls.Add(avatar);
            }
        }
Example #2
0
        private void FrmSettings_Load(object sender, EventArgs e)
        {
            base.EnableCancelButton          = true;
            this.textBoxServerIP.Text        = Settings.CurrentSettings.ClientPara.ServerIP;
            this.textBoxServerPort.Text      = Settings.CurrentSettings.ClientPara.ServerPort.ToString();
            this.textBoxLocalServerPort.Text = Settings.CurrentSettings.ServerPort.ToString();
            this.checkBoxHideClient.Checked  = Settings.CurrentSettings.ClientPara.IsHide;
            string onlineAvatar     = Settings.CurrentSettings.ClientPara.OnlineAvatar;
            string onlineAvatarPath = RSCApplication.GetPath(ePathType.AVATAR_DIR) + onlineAvatar;

            if (!string.IsNullOrWhiteSpace(onlineAvatarPath) && System.IO.File.Exists(onlineAvatarPath))
            {
                this.pictureBoxAvatar.Tag             = onlineAvatar;
                this.pictureBoxAvatar.BackgroundImage = Image.FromFile(onlineAvatarPath);
            }
            string clientIconPath = Settings.CurrentSettings.ClientPara.ClientIconPath;

            if (!string.IsNullOrWhiteSpace(clientIconPath) && System.IO.File.Exists(clientIconPath))
            {
                this.pictureBoxAppIcon.Tag             = clientIconPath;
                this.pictureBoxAppIcon.BackgroundImage = Image.FromFile(clientIconPath);
                checkBoxAppIcon.Checked = true;
            }
        }