Question: I'm having a hard time getting my C# program to work in visual basic, the program should be able to have the user input a
I'm having a hard time getting my C# program to work in visual basic, the program should be able to have the user input a line of text, have a selection of buttons to choose from, and display said text on a read only text box after pressing the Ok button. Once done, the user should click only any choice of buttons to alter the read only text box. The choices of buttons are colors red, blue, green, and black, along with aligning the text center or right, and a button that will clear the text box (as well as the exit button).
My code so far:
for the colors private void btnRed_Click(object sender, EventArgs e) { lblMessageDisplay.ForeColor = Color.Red; } the ok button private void btnOk_Click(object sender, EventArgs e) { btnOk.Text = "&Ok"; lblMessageDisplay.Text = txtUserMessage.Text; txtUserMessage.Focus(); txtUserMessage.SelectAll(); } text alignment private void btnRight_Click(object sender, EventArgs e) { lblMessageDisplay.TextAlign = ContentAlignment.MiddleCenter; }
clear button private void btnClear_Click(object sender, EventArgs e) { btnClear.Text = "&Clear"; txtUserMessage.Text = String.Empty; txtUserMessage.Focus();
}
Would I have to do something similar with the Ok button for the colors and other buttons in order for this to work?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
