Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
how to set listbox bordercolor at runtime in vb.net
Posted
Comments
Bala Selvanayagam 2-Nov-11 5:57am    
web / windows / wpf ?

1 solution

If this is a Windows Forms Application then I don't think there is a simple solution. However if this is a WPF Application in your Loaded event just change the listBox BorderBrush property (e.g.
C#
listBox1.BorderBrush = Brushes.Green
).

or for Asp.net in the Page_Load event:

C#
ListBox1.BorderColor = System.Drawing.Color.Green


Note: If you want to do this in another event say a Button Click event it will cause the page to refresh. If you do not want this to happen you will have to use AJAX.
 
Share this answer
 
v5
Comments
VenuKalyan 4-Nov-11 1:40am    
my application was web..
LanFanNinja 4-Nov-11 15:01pm    
Well if you have not figured it out yet I believe this will do the trick.
listBox1.BorderColor = System.Drawing.Color.Green

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900