public void InitControls() { ucGroup = new ucGroup(); panelAllUser = new Panel(); panelAllUser.AutoScroll = true; panelOnlineUser = new Panel(); panelOnlineUser.AutoScroll = true; panelPending = new Panel(); panelPending.AutoScroll = true; panelListSearch = new Panel(); panelListSearch.AutoScroll = true; ucSearch = new ucSearch(FrmMain.UserUIs, pnContainListSearch, false, false); this.pnContainSearch.Controls.Add(ucSearch); this.Controls.Add(panelAllUser); this.Controls.Add(panelOnlineUser); this.Controls.Add(panelPending); this.Controls.Add(ucGroup); this.InitPanelAllUser(); this.InitPanelOnlineUser(); this.InitPanelPending(); this.InitPanelListSearch(); CheckLoadAllUser = false; labelCOUNT.Text = ""; btnFocus = null; picPoint.Visible = false; }
public FrmMain(FrmLogin loginform, User user, SocketClient client, TcpClient server, string Theme) { acceptClose = true; frmLoading = new FrmLoading(); time = false; tick = 0; timer = new Timer(); frmLoading.TopLevel = false; frmLoading.Dock = DockStyle.Fill; frmLoading.BringToFront(); frmLoading.Show(); this.Controls.Add(frmLoading); timer.Interval = 1000; timer.Tick += (timersender, timerEvent) => { tick++; if (time == true && tick > 1) { timer.Stop(); this.Controls.Remove(frmLoading); } }; timer.Start(); this.loginForm = loginform; FrmMain.client = client; FrmMain.server = server; FrmMain.me = user; theme = new Theme(); if (Theme == "Black") { theme.Black(); } else { theme.White(); } InitializeComponent(); Panel temp = new Panel(); temp.Dock = DockStyle.Fill; temp.BackColor = Color.Transparent; this.panelRIGHT.Controls.Add(temp); temp.BringToFront(); temp.Show(); UserUIs = new List <UserUI>(); listUser = new List <User>(); listMessAwaitID = new List <ucUserINChatBox>(); listFileAwaitID = new List <ucUserINChatBox>(); GroupUIs = new List <GroupUI>(); listGroup = new List <Group>(); frmContactBook = new FrmContactBook(this); UcGroup = new ucGroup(this, GroupUIs); AddToGroup = new FrmADDMemberToGroup(this); frmADD = new FrmADD(this); frmADDMemberToContact = new FrmADDMemberToContact(this); me.AvatarPath = @"./images/avatarDefault/avatarDefault.png"; LoadDataUser(); InitServerUsersForm(); InitFrmFriend(); InitSettingForm(); LoadGroupData(); LoadContactBook(); if (Theme == "Black") { ChangeTheme(); } LoadMyData(); AwaitReadData(); this.SizeChanged += new EventHandler(Form1_SizeChanged); }