Friday, July 31, 2009

Bullets in a Textbox for every EnterKey Press

-------------------------------------------------------------------------------------
I have a multiline textbox and I want to have a bullet show before the first line typed in the tetbox and a bullet submitted for everytime the user hits enter.

I got somewhat of a bullet to appear when the user hits enter and but it appeared after the text not before. This is what I got:

SOL:-
private void pad2_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
{
pad2.AppendText("-");
}
}

SOL:-

You can use:

pad2.Text = "-" + pad2.Text;

This will prepend your character before your text string.


SOL:-
Try using • or [alt]+0149 to get an actual bullet. That is as ascii key code for a bullet!
--------------------------------------------------------------------------------------

No comments:

Post a Comment

Followers