Hello all, how can I change the border color of a wxTextCtrl?
Thank's.
Border Colors Topic is solved
-
- Experienced Solver
- Posts: 72
- Joined: Fri Feb 20, 2009 7:13 pm
- Location: $(#wx)\src
Hi,
wxTextCtrl has native implementation so the border color is set by the OS theme.
You can try a workaround - use wxNO_BORDER for the wxText, add it to a sizer, add the sizer to a wxPanel of size
( 2*borderThickness + txtCtrl.width , 2*borderThickness + txtCtrl.height )
, draw a rectangle on the panel to replace the border of the wxTextCtrl.
HTH
wxTextCtrl has native implementation so the border color is set by the OS theme.
You can try a workaround - use wxNO_BORDER for the wxText, add it to a sizer, add the sizer to a wxPanel of size
( 2*borderThickness + txtCtrl.width , 2*borderThickness + txtCtrl.height )
, draw a rectangle on the panel to replace the border of the wxTextCtrl.
HTH
-
- In need of some credit
- Posts: 2
- Joined: Tue Mar 17, 2009 1:36 pm
Please accept the post that helped you, not yours.fabianomartins wrote:Thank's I'll try!
Thanks
PS: Just to add on Catalin's trick. There is very likely no need to manually set ( 2*borderThickness + txtCtrl.width , 2*borderThickness + txtCtrl.height ), as wxSizer::Add lets you specify a border. Also, you may not need to draw a rectangle on the panel, you might just want to set its background color, which is much simpler.