private void UpdateStatus(object sender, EventArgs <string> e) { StringBuilder statusText = new StringBuilder(); statusText.Append(TextBoxStatus.Text); statusText.Append(e.Argument); statusText.Append(Environment.NewLine); TextBoxStatus.Text = statusText.ToString().TruncateLeft(TextBoxStatus.MaxLength); TextBoxStatus.SelectionStart = TextBoxStatus.Text.Length; TextBoxStatus.ScrollToCaret(); }
private void ButtonPostStatus_Click_1(object sender, EventArgs e) { try { if (LoggedInUser != null) { LoggedInUser.PostStatus(TextBoxStatus.Text); MessageBox.Show("Status Posted successfully! :)"); TextBoxStatus.Clear(); } else { throw new Exception("You must be logged in, in order to proceed."); } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } }