wxPython - Change Foreground Colour of Button Last Updated : 24 Jun, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article we will learn how can we change the foreground colour of the button or the font colour of the button. To do this we will use SetForegroundColour() function associated with wx.Button class of wxPython. SetForegroundColour() function simply takes wx.Colour argument for the foreground. Syntax: wx.Button.SetForegroundColour(self, colour) Parameters: Parameter Input Type Description colour wx.Colour colour for the foreground. Code Example: Python3 1== import wx class Example(wx.Frame): def __init__(self, *args, **kwargs): super(Example, self).__init__(*args, **kwargs) self.InitUI() def InitUI(self): self.locale = wx.Locale(wx.LANGUAGE_ENGLISH) # create parent panel for button self.pnl = wx.Panel(self) # create button at point (20, 20) self.btn = wx.Button(self.pnl, id = 1, label ="Button", pos =(20, 20), size =(300, 40), name ="button") # change foreground colour of button to blue self.btn.SetForegroundColour((0, 0, 255, 255)) self.SetSize((350, 250)) self.SetTitle('wx.Button') self.Centre() def main(): app = wx.App() ex = Example(None) ex.Show() app.MainLoop() if __name__ == '__main__': main() Output Window: Comment More infoAdvertise with us Next Article wxPython - Change Foreground Colour of Button R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Python wxPython-Button Practice Tags : python Similar Reads wxPython - Change Font colour of Radio Button In this article we are going to learn that how can we change the foreground or font color of the radio button. In order to change the foreground colour of Radio Button we will use SetForegroundColour() function. SetForegroundColour() function sets the foreground colour of the window. The meaning of 2 min read wxPython - Change Cursor on hover on Button In this article we will learn that how can we change cursor when it hovers on Button present in frame. We need to follow some steps as followed. Step 1- Create a wx.Image object with image you want to use as cursor image. Step 2- Create a wx.Cursor object and pass wx.Image object above created. Step 1 min read Change color of button in Python - Tkinter In this article, we are going to write a Python script to change the color of the button in Tkinter. It can be done with two methods:Using bg properties.Using activebackground properties.Prerequisite: Creating a button in tkinter, Python GUI â Tkinter Change the color of the button in Python - Tkint 1 min read wxPython - Change Background colour of Button In this article we are going to learn about how can we change background colour of a button present in a frame. We use SetBackgroundColour() function to set background colour of the button to some different colour. It takes a wx.Colour class object as an argument. Syntax: wx.Button.SetBackgroundColo 1 min read wxPython - Change Background Colour of Radio Button In this article we are going to learn about how can we change background colour of a Radio Button. We will use SetBackgroundColour() function sets the background colour of the window. Notice that as with SetForegroundColour, setting the background colour of a native control may not affect the entire 1 min read Like