public ucInfoGroup()
        {
            InitializeComponent();
            pnaddfile.Visible   = false;
            pnaddmember.Visible = false;

            pnfile.AutoSize   = true;
            pnmember.AutoSize = true;
            this.mainForm     = this.frmMain.GroupUI.MAINFORM;
            this.frmADD       = new FrmADD(mainForm);
        }
        public ucInfoGroup(FrmGroup frmMain)
        {
            this.frmMain = frmMain;
            InitializeComponent();
            InitControls();
            locationlabel(ref lbName, pnavata_name);
            locationlabel(ref lbID, pnavata_name);
            locationpanel(ref panel1, pnavata_name);
            pnaddfile.Visible   = false;
            pnaddmember.Visible = false;

            pnfile.AutoSize   = true;
            pnmember.AutoSize = true;

            this.mainForm = this.frmMain.GroupUI.MAINFORM;
            this.frmADD   = new FrmADD(mainForm);
            this.frmMain.Pncontaininfor.Controls.Add(this);
            this.Dock = DockStyle.Top;
        }
Exemple #3
0
        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);
        }