public ShowContent(Content content, string fromtopic, ShowTopic fromShowTopicForm) { InitializeComponent(); topic = fromtopic; this.content = content; this.showTopicForm = fromShowTopicForm; }
public void Update(Content content, string fromtopic, ShowTopic fromShowTopicForm) { topic = fromtopic; this.content = content; this.showTopicForm = fromShowTopicForm; lbDate.Text = content.DateTime.ToShortDateString(); lbProblem.Text = content.Problem; rtbContent.Text = content.ContentText; lbTopic.Text = topic; }
private void btnView_Click(object sender, EventArgs e) { if (lBxTOpic.SelectedItem == null) { return; } if (showTopicForm == null) { showTopicForm = new ShowTopic(lBxTOpic.SelectedItem.ToString(), this); } else { showTopicForm.Update(lBxTOpic.SelectedItem.ToString(), this); } this.Hide(); showTopicForm.Show(); }