private void btnLogin_Click(object sender, EventArgs e) { if (txtId.Text != "" && txtPassword.Text != "" && txtId.Text != "아이디" && txtPassword.Text != "비밀번호") { Console.WriteLine("Login ID : {0}", txtId.Text); Console.WriteLine("Login Password : {0}", txtPassword.Text); if (ma.IsDisposed) // 컨트롤이 죽었으면 { ma = new MainDisplay(); // 다시 인스턴스생성하고 열어줍니다 ma.Show(); } else { ma.Show(); } txtId.Text = "아이디"; txtId.ForeColor = Color.Gray; txtPassword.Text = "비밀번호"; txtPassword.ForeColor = Color.Gray; } else { MessageBox.Show("ID, Password Input"); } }
private void btnLogin_Click(object sender, EventArgs e) { if (ma.IsDisposed) // 컨트롤이 죽었으면 { ma = new MainDisplay(); // 다시 인스턴스생성하고 열어줍니다 ma.Show(); } else { ma.Show(); } }
public CommentDisplay(MainDisplay md) { this.md = md; InitializeComponent(); Console.WriteLine("commendisplay"); for (int i = 0; i < c_list.Length; i++) { c_list[i] = new comment_list(); c_list[i].Name = "Seo Jisu" + i.ToString(); c_list[i].Imagebox = Resources.jisu; c_list[i].Comment = "check" + i; ; if (flowLayoutPanel1.Controls.Count < 0) { flowLayoutPanel1.Controls.Clear(); } flowLayoutPanel1.Controls.Add(c_list[i]); } }
public listItem(MainDisplay md) { this.maindis = md; InitializeComponent(); pictureBox1.Parent = lvw_main.picure_main; pictureBox1.BackColor = Color.Transparent; pictureBox2.Parent = lvw_main.picure_main; pictureBox2.BackColor = Color.Transparent; // panel7.Visible = false; music.Parent = lvw_main.picure_main; music.BackColor = Color.Transparent; for (int i = 0; i < LP.Length; i++) { LP[i] = new listPictiure(); } LP[0].Image_main = Resources.jisu; LP[1].Image_main = Resources.jisu2; LP[2].Image_main = Resources.soo; LP[3].Image_main = Resources.seulgi; }
public firstMain(MainDisplay maindisplay) { InitializeComponent(); this.maindisplay = maindisplay; string User_ID = setuser.getUser_id(); Func <Task> runAsync = async() => { try { postList = await client.GetFriendsPost(User_ID).ConfigureAwait(false); Console.WriteLine(User_ID); Console.WriteLine(postList.Count); listCount = postList.Count(); U_ID = new string[listCount]; int j = 0; if (listCount > 0) { outsider = false; foreach (var postItem in postList) { Console.WriteLine(postItem.userNumber); U_ID[j] = (await client.GetUserID(postItem.userNumber).ConfigureAwait(false)); j++; } } } catch (Exception q) { Console.WriteLine(q.Message); } }; runAsync().GetAwaiter().GetResult(); int i = 0; if (outsider) { Console.WriteLine("OutSider!"); } else { LT = new listItem[listCount]; this.flowLayoutPanel1.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.flowLayoutPanel1_MouseWheel); foreach (var postItem in postList) { LT[i] = new listItem(maindisplay); LT[i].Name = U_ID[i]; LT[i].Imagebox = Resources.jisu; LT[i].MainImage = LT[i].LP[0].Image_main; LT[i].Music_name = "러블리즈_Sweet Dream.mp3"; LT[i].time = postItem.time; LT[i].Message = postItem.content; i++; if (flowLayoutPanel1.Controls.Count < 0) { flowLayoutPanel1.Controls.Clear(); } Console.WriteLine("lovelz"); } flowLayoutPanel1.Controls.Add(LT[0]); } }
private void btnLogin_Click(object sender, EventArgs e) { bool result = false; Func <Task> runAsyn = async() => { try { if (await client.SendLoginInfo(txtId.Text.ToString(), txtPassword.Text.ToString()).ConfigureAwait(false)) { result = true; } else { result = false; } } catch (Exception q) { Console.WriteLine(q.Message); } }; if (txtId.Text != "" && txtPassword.Text != "" && txtId.Text != "아이디" && txtPassword.Text != "비밀번호") { runAsyn().GetAwaiter().GetResult(); if (result) { setuser.setUser_id(txtId.Text.ToString()); ma = new MainDisplay(); ma.Show(); //if (ma.IsDisposed) // 컨트롤이 죽었으면 // { // ma = new MainDisplay(); // 다시 인스턴스생성하고 열어줍니다 // ma.Show(); // } // else // { // ma.Show(); // } // if (ma.IsDisposed) // 컨트롤이 죽었으면 // { // ma = new MainDisplay(); // 다시 인스턴스생성하고 열어줍니다 // ma.Show(); // } } else { MessageBox.Show("로그인 오류!"); } txtId.Text = "아이디"; txtId.ForeColor = Color.Gray; txtPassword.PasswordChar = '\0'; txtPassword.Text = "비밀번호"; txtPassword.ForeColor = Color.Gray; } else { MessageBox.Show("ID, Password Input"); } }