|
-
Nov 4th, 2003, 11:22 AM
#1
Thread Starter
I wonder how many charact
Change border color of listbox
I have had ample sucess with changing border colors of flat-style textboxes, labels, etc..
unfortuantely, I still cannot figure how to draw a border properly around a listbox.
I have been overriding the WndProc method and capturing msg 15, but unfortunately, this seems to draw inside the client area. I can't get to the 1 pixel border around the listbox.
If I set the BorderStyle of the Listbox to none, I can have a 1 pixel border around the listbox (but its actually drawing inside the client area, which is poor since it leaves lines all over the place.)
I don't know if inflating the cliprectangle by 1 pixel will solve the problem (not sure if I should bother trying)
Anyone have success with this?
-
Nov 4th, 2003, 04:27 PM
#2
this may seem an unconvensional method, but have you tried setting the listbox on a Panel , with the panel set slightly bigger than the listbox and the backcolor of the panel set to your choice of color that would emulate a color border? eg:
VB Code:
ListBox1.BorderStyle = BorderStyle.None
With Panel1
.BorderStyle = BorderStyle.None
.BackColor = Color.SteelBlue
.Height = ListBox1.Height + 4
.Width = ListBox1.Width + 4
.Location = New Point(ListBox1.Location.X - 2, ListBox1.Location.Y - 2)
ListBox1.BringToFront()
End With
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|