wxListView resizable

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
johnRipper1
In need of some credit
In need of some credit
Posts: 4
Joined: Sat May 27, 2023 8:29 pm

wxListView resizable

Post by johnRipper1 »

Hi everyone , i'm new on the wxwidgets i have 2 questions about wxListView .

1- how i can stop the user to resize the wxListView ?
2- how i can change the background color of the columns in the wxListView?


thx for reading and responde
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxListView resizable

Post by doublemax »

johnRipper1 wrote: Sat May 27, 2023 8:36 pm 1- how i can stop the user to resize the wxListView ?
A wxListView on its own can not be resized by the user, only the outer toplevel window can. I assume you currently have only one wxListView in your sample app. In that special case the single control will always be scaled to fill the whole toplevel window. But this will change if you add more controls. You should place these controls in a wxSizer structure to control their layout. https://neume.sourceforge.net/sizerdemo/

To prevent the toplevel window from getting resized by the user, don't pass the wxRESIZE_BORDER flag to its constructor. (Which is part of the default wxDEFAULT_FRAME_STYLE flag). https://docs.wxwidgets.org/trunk/toplev ... c8fd8e95e2

johnRipper1 wrote: Sat May 27, 2023 8:36 pm 2- how i can change the background color of the columns in the wxListView?
wxListView does not support that. If you need this, you'd have to use a virtual wxListCtrl in list mode.
https://docs.wxwidgets.org/trunk/classwx_list_ctrl.html
Use the source, Luke!
johnRipper1
In need of some credit
In need of some credit
Posts: 4
Joined: Sat May 27, 2023 8:29 pm

Re: wxListView resizable

Post by johnRipper1 »

thx for your effort
Post Reply