wxPython - Change Button Label Font Last Updated : 06 Jan, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article we are going to learn that how can we change the font of the label text present on the button present in the frame. We need to follow some steps as follows: Step 1: Create a wx.Font object. Step 2: Add different attributes of font in parameters like: family, style etc. Step 3: Set font by using SetFont() function. Syntax: wx.Button.SetFont(self, font)Parameters: ParameterInput TypeDescriptionfontwx.FontFont for the button label. Code Example: Python3 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) self.pnl = wx.Panel(self) # wx.Font object initialization font = wx.Font(12, wx.FONTFAMILY_MODERN, 0, 90, underline = False, faceName ="") # CREATE BUTTON AT POINT (20, 20) self.st = wx.Button(self.pnl, id = 1, label ="Button", pos =(20, 20), size = wx.DefaultSize, name ="button") # SET FONT FOR LABEL self.st.SetFont(font) 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 font of Radio Button R RahulSabharwal Follow Improve Article Tags : Python Python-gui Python-wxPython Python wxPython-Button Practice Tags : python Similar Reads wxPython - Change font of Radio Button In this article we are going to learn that how can we change the font of the label text present on the radio button present in the frame. We need to follow some steps as follows: Step 1: Create a wx.Font object. Step 2: Add different attributes of font in parameters like: family, style etc. Step 3: 1 min read wxPython - change size of Button In this article we are going to learn about SetSize() function associated with wx.Button class of wxPython. SetSize() function is simply used to change the size of the button present in the frame. SetSize function takes a wxSize argument to change the size of button. Syntax: wx.Button.SetSize(self, 1 min read wxPython - Change labels using button In this article we are going to learn how to make button interactive with the frame. In this article we will change the text label on the pressing button. So let's start with the steps. Step 1: Create a static text on the frame. Step 2: Add button to the frame. Step 3: Create event function for the 1 min read wxPython - Change Size of Radio Button In this article we will learn to change size of a Radio Button. We will change the size of Radio Button using SetSize() function associated with wx.RadioButton class of wxPython. SetSize() function is simply used to change the size of the window of Radio Button in pixels. Syntax: wx.RadioButton.SetS 1 min read 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 - SetLabel() function in wx.Button In this article we are going to learn about SetLabel() function associated with wx.Button class of wxPython. SetLabel() function is used to set the string label for the button. It takes a string parameter that is used as label for button. Syntax: wx.Button.SetLabel(self, label) Parameters: Parameter 1 min read Like