Ask Your Question
2

How can you change the background color of only the File/Path box in wx.FilePickerCtrl instead of changing the entire object's color?

asked 2021-12-09 11:00:00 +0000

qstack gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-11-05 08:00:00 +0000

lalupa gravatar image

You can use the SetBackgroundColour method to set the background color of the parent container of the wx.FilePickerCtrl, and then use CSS or other styling techniques to target only the File/Path box within the container and set its background color separately.

For example, if you have a wx.FilePickerCtrl within a wx.Panel, you could use the following code to set the background color of the panel to white:

panel.SetBackgroundColour(wx.WHITE)

Then, you could use CSS or other styling techniques to target the File/Path box within the panel and set its background color to a different color, such as blue:

wx.FilePickerCtrl {
  background-color: blue;
}

Note that the specific CSS syntax may vary depending on your programming language and the way you are rendering the wx.FilePickerCtrl.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-12-09 11:00:00 +0000

Seen: 10 times

Last updated: Nov 05 '21