Why my wxListCtrl style is different from the sample? Topic is solved

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
freshairfly
Earned a small fee
Earned a small fee
Posts: 21
Joined: Mon Jan 28, 2008 1:55 am

Why my wxListCtrl style is different from the sample?

Post by freshairfly »

Hi All,

I'm a newbie of wxWidgets. I'm using wxListCtrl in report mode, and I found that the effect (header style, see pictures) of mine is different from the example (listctrl in samples folder). I can't find the what reason causes that.

My demo appliction screenshot:
Image

Example screenshot in offical release:

Image

I run these codes on Windows XP, and my demo code is like this:

Code: Select all

    long style = wxLC_REPORT | wxLC_EDIT_LABELS | wxSUNKEN_BORDER;
    wxListCtrl* pListCtrl = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style);

    pListCtrl->InsertColumn(0, _T("First Column"));
    pListCtrl->InsertColumn(1, _T("Second Column"));
    pListCtrl->SetColumnWidth(0, 150);
    pListCtrl->SetColumnWidth(1, 150);
Any tip is welcome.

Andraw
Ugly!
Earned some good credits
Earned some good credits
Posts: 113
Joined: Mon May 09, 2005 5:11 am
Location: Argentina - BS AS

Post by Ugly! »

Your are probably missing the Windows XP style...

From the wiki:
If project uses a resource (.rc), add the line: #define wxUSE_NO_MANIFEST 1

- i.e. the 'text' sample .rc file will look like this:

mondrian ICON "mondrian.ico"
#define wxUSE_NO_MANIFEST 1
#include "wx/msw/wx.rc"
Open your .rc file and the line:
#define wxUSE_NO_MANIFEST 1

Regards, Matías
Just a newbie - Too many interests, not too many time.

Windows XP SP2
Kubuntu GNU/Linux - Feisty
wxActiveRecordGenerator (aka wxARG) maintainer
Find it at wxCode
lester
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 211
Joined: Sat Sep 02, 2006 7:24 pm
Location: Ukraine

Post by lester »

Ugly! wrote:Your are probably missing the Windows XP style...

From the wiki:
If project uses a resource (.rc), add the line: #define wxUSE_NO_MANIFEST 1

- i.e. the 'text' sample .rc file will look like this:

mondrian ICON "mondrian.ico"
#define wxUSE_NO_MANIFEST 1
#include "wx/msw/wx.rc"
Open your .rc file and the line:
#define wxUSE_NO_MANIFEST 1

Regards, Matías
but scrollbar themed
freshairfly
Earned a small fee
Earned a small fee
Posts: 21
Joined: Mon Jan 28, 2008 1:55 am

Post by freshairfly »

Ugly! wrote:Your are probably missing the Windows XP style...

From the wiki:
If project uses a resource (.rc), add the line: #define wxUSE_NO_MANIFEST 1

- i.e. the 'text' sample .rc file will look like this:

mondrian ICON "mondrian.ico"
#define wxUSE_NO_MANIFEST 1
#include "wx/msw/wx.rc"
Open your .rc file and the line:
#define wxUSE_NO_MANIFEST 1

Regards, Matías
Matías, thanks very much!
It does work.
Post Reply