public FormChatClient()//建構值 { InitializeComponent(); msgHandler = this.addMsg; //因為有回傳值,所以程式打開始先要讓建構值的東西放在他自己所建立好的參數,以便他執行續用到的時候好抓取(110.03.15) //若不寫在這裡的話可以寫在FormChatClient_Load裡面(此方法是打開程式就要先執行的地方像是initial的概念)(110.03.15) }
public SPDB_S_Main() { InitializeComponent(); // Sever IP SvrIP = new System.Net.IPAddress(Dns.GetHostByName(Dns.GetHostName()).AddressList[0].Address); label_IP.Text = "IP : " + SvrIP.ToString(); // 繪圖板初始化 pictureBox_Draw.Parent = pictureBox_BG; pictureBox_Draw.Location = new Point(0, 0); pictureBox_BG.Image = Image.FromFile(Application.StartupPath + "\\null.jpg"); pictureBox_Draw.Image = new Bitmap(590, 400); // 文字工具初始化 textBox_A.Parent = pictureBox_Draw; // 模式初始化 mode = "鉛筆"; color = Color.Black; size = 1; // 聊天對象初始化 comboBox1.SelectedIndex = 0; // 委派處理文字 msgHandler = this.dealMsg; }
public RegisterForm() { InitializeComponent(); msgHandler = this.addMsg; secretTextBox.PasswordChar = '*'; }
public Thread newListener(StrHandler pHandler) { inHandler = pHandler; Thread listenThread = new Thread(new ThreadStart(listen)); listenThread.Start(); return listenThread; }
public Thread newListener(StrHandler pHandler) { inHandler = pHandler; Thread listenThread = new Thread(new ThreadStart(listen)); listenThread.Start(); return(listenThread); }
public Form1() { InitializeComponent(); msgHandler = this.dataRefresh; errorHandler = this.errorRefresh; //全螢幕 //this.FormBorderStyle = FormBorderStyle.None; //this.WindowState = FormWindowState.Maximized; //this.TopMost = true; }
String friendAccountTemp = ""; //暫存欲加入好友帳號 public LoginForm() { InitializeComponent(); //this.tabPage2.Parent = null; //hide _myAccount = new ClientAccount(); msgHandler = this.addMsg; createConnection = new ConectionSetting(); secretTextBox.PasswordChar = '*'; //輸入密碼時顯示為"*" }
public Thread newlistener(StrHandler pHandler) //建立一個傾聽者去傾聽對方送訊息過來的事件 //讓他能夠用pHandler去處理訊息 { inHandler = pHandler; Thread listenThread = new Thread(new ThreadStart(listen)); //這邊是掛上執行續(委派delegate),讓每次有連進來的時候(對象)說些什麼加以紀錄-(每一個連進來的對象都是一個獨立的個體所以需要執行續用來持續監控訊息)(110.03.15) //若不掛執行續,很多人連是沒錯但這邊會變得只能一個訊息,沒辦法切開是誰傳的訊息(因為都全部混再一起)(110.03.15) listenThread.Start(); return(listenThread); }
public Form1() { _5pW = _5pL = _5pD = 0; p5flag = drawflag = imgflag = whsflag = true; this.Hide(); this.Location = new Point(150, 150); //this.ShowInTaskbar = true; InitializeComponent(); //Gomoku a = new Gomoku(); //a.ShowDialog(); this.ShowInTaskbar = true; trackBar1.Hide(); ColorBox.Hide(); button2.Hide(); Login log = new Login(); log.ShowDialog(); if (log.DialogResult == DialogResult.Cancel) { this.Close(); } else { this.Show(); //this.ShowInTaskbar = true; SetUpData init = log.Get(); Username = init.UserName; MLabel.Hide(); //Box.ForeColor = Bcolor; UserBox.DataSource = UserList; myGraphic = DrawBox.CreateGraphics(); DrawBox.BringToFront(); c.Setup(init.IP, init.Port); //addMsg("2.成功連線"); msgHandler = this.addMsg; dwHandler = this.addDw; imgHandler = this.ShowPic; c.Recv(processMsgComeIn, processDwComeIn, processImgComeIn); //MessageBox.Show("歡迎加入~"); } }
public void Recv(StrHandler h, StrHandler c, Img i) { inHandler = h; inControl = c; inImg = i; try { Ct.BeginReceive(Data, 0, 1024 * 8, SocketFlags.None, EndRecv, null); } catch { } }
public void connect(StrHandler pHandler, errorHandler eHandler) { try { inHandler = pHandler; errorHandler = eHandler; myTcpClient.Connect(myIpEndPoint); myTcpClient.ReceiveTimeout = 1000; myTcpClient.SendTimeout = 1000; workState = true; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
//================================================ //init public MainForm() { InitializeComponent(); Application.VisualStyleState = VisualStyleState.NoneEnabled; //_schedule.recieveData(); //_account.recieveData(); _myAccount = new ClientAccount(); msgHandler = this.addMsg; createConnection = new ConectionSetting(); secretTextBox.PasswordChar = '*'; //輸入密碼時顯示為"*" this.mainPage.Parent = this.mainTabControl; //隱藏登入分頁 this.friendTabPage.Parent = null; //顯示好友分頁 this.calendarTabPage.Parent = null; //顯示行事曆分頁 this.accountTabPage.Parent = null; //顯示記帳分頁 }
public SPDB_C_Main() { InitializeComponent(); // 繪圖板初始化 pictureBox_Draw.Parent = pictureBox_BG; pictureBox_Draw.Location = new Point(0, 0); pictureBox_BG.Image = Image.FromFile(Application.StartupPath + "\\null.jpg"); pictureBox_Draw.Image = new Bitmap(590, 400); // 文字工具初始化 textBox_A.Parent = pictureBox_Draw; // 模式初始化 mode = "鉛筆"; color = Color.Black; size = 1; // 聊天對象初始化 comboBox1.SelectedIndex = 0; // 委派處理文字 msgHandler = this.dealMsg; }
public Form1() { //Form.CheckForIllegalCrossThreadCalls = false; InitializeComponent(); msgHandler = this.addMsg; isLogin = false; Login.Enabled = false; fileName.ReadOnly = true; //allmh = new allMessageHandler(AddAllMessage); // 初始化map 空=0 黑=1 白=2 觀察者=3 stepcnt = 0; for(int i=0; i<map.GetLength(0); i += 1) { for(int j=0; j<map.GetLength(1); j += 1) { map[i, j] = CommandWords.NOONE; step[i, j] = 0; } } }
public chatRoomManagement() { InitializeComponent(); msgHandler = this.addMsg; }
public FormChatClient() { InitializeComponent(); msgHandler = this.addMsg; }