i'm just a newbie here in c# and still a lot more to learn, but i just want to know how can i convert into uppercase the first letter in a textbox inputted by the user if they input a lowercase letter. can somebody help me? please..just needed to complete our project... thank you for the reply..

i'm just a newbie here in c# and still a lot more to learn, but i just want to know how can i convert into uppercase the first letter in a textbox inputted by the user if they input a lowercase letter. can somebody help me? please..just needed to complete our project... thank you for the reply..

You need to handle keypress event. Take a look at code-snippet.

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (Char.IsLower(e.KeyChar))
                e.KeyChar = Char.ToUpper(e.KeyChar);
        }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.