wxColourDialog, set position on screen (Windows)?

7 views
Skip to first unread message

Tony Kennedy

unread,
7:59 AM (15 hours ago) 7:59 AM
to wx-users
Using wx 3.3.1 on Windows.

I'm having a lot of trouble setting the position of the standard wxColourDialog on Windows.

Even with very simple code, the dialog always appears top left.

wxColourData data;
data.SetColour(*pDefaultColour);
wxColourDialog dlg1(pParent, &data);
dlg1.Move(500, 500);
dlg1.ShowModal();

Is there a knack to getting this to work?

Thanks in advance,

Tony.

Vadim Zeitlin

unread,
9:16 AM (14 hours ago) 9:16 AM
to wx-u...@googlegroups.com
On Tue, 9 Dec 2025 04:59:30 -0800 (PST) Tony Kennedy wrote:

TK> Using wx 3.3.1 on Windows.
TK>
TK> I'm having a lot of trouble setting the position of the
TK> standard wxColourDialog on Windows.

Specifying position for native dialogs is not supported by Windows, so
this doesn't work there. If you absolutely must have the dialog at a
fixed location you could use wxGenericColourDialog but it doesn't really
look like the native dialog.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
https://www.tt-solutions.com/

Tony Kennedy

unread,
10:57 AM (12 hours ago) 10:57 AM
to wx-users
Thanks for the help.

Am I right in saying I need to add "colrdlgg.cpp" to my project to get access to the generic dialog?

I appreciate that it does not look like the native dialog, but I've got a toolbar along the bottom of the app. And it appears fine over the toolbar, but you have to move it up to click the "ok" button, I'd much prefer it I could just set the location manually to avoid the user having extra clicks.

Tony.



Reply all
Reply to author
Forward
0 new messages