Hi Gud Morning ,
My Problem is Set Boarder color in textbox,set boarder color single textbox is working fine
but i want to set multiple textboxes set boarder color .
if any body knows please let me know.
Thank you in Advance.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Manas MohapatraRank #182 · 13.2K reputationPosted Oct 5, 2015, 9:02 PM EDT
Bhushan BhasmeRank #2,348 · 604 reputationPosted Oct 5, 2015, 9:05 PM EDT
Nilesh JadavRank #109 · 20.3K reputationPosted Oct 5, 2015, 9:11 PM EDT
http://www.c-sharpcorner.com/uploadfile/mahesh/textbox-in-C-Sharp/
http://www.codeproject.com/Questions/95669/How-to-change-Textbox-BorderColor-in-C
Vipan SharmaRank #1,589 · 999 reputationPosted Oct 5, 2015, 9:25 PM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Oct 5, 2015, 9:28 PM EDT
if ($('#TextBoxID').val() == '') { $('#TextBoxID').css('border-color', 'red'); } else { $('#TextBoxID').css('border-color', ''); }praveen kumar36 reputationPosted Oct 5, 2015, 10:33 PM EDT
praveen kumar36 reputationPosted Oct 5, 2015, 10:36 PM EDT
Vipan SharmaRank #1,589 · 999 reputationPosted Oct 5, 2015, 10:41 PM EDT
bool focus = false; private void Form1_Paint(object sender, PaintEventArgs e) { if (focus) { textBox1.BorderStyle = BorderStyle.None; Pen p = new Pen(Color.Red); Graphics g = e.Graphics; int variance = 3; g.DrawRectangle(p, new Rectangle(textBox1.Location.X - variance, textBox1.Location.Y - variance, textBox1.Width + variance, textBox1.Height +variance )); } else { textBox1.BorderStyle = BorderStyle.FixedSingle; } } private void textBox1_Enter(object sender, EventArgs e) { focus = true; this.Refresh(); } private void textBox1_Leave(object sender, EventArgs e) { focus = false; this.Refresh(); } refer original link for more information http://stackoverflow.com/questions/9768938/change-the-bordercolor-of-the-textbox P.S Kindly explain All your requirement before submit the question. It will help to solve thread soon and save time of every person related to answer the question..Manas MohapatraRank #182 · 13.2K reputationPosted Oct 5, 2015, 11:12 PM EDT