[wxPython] change ScrollBar background colour.

Post here if you need help with creating a Graphical User Interface in Python.

[wxPython] change ScrollBar background colour.

Postby Vik2015 » Wed May 07, 2014 6:12 pm

Looks like it is impossible to completely remove scrollbar from wx.TextCtrl, so I came up with a workaround. I may change scrollbar's background colour, so it will be almost invisible. But, how can I change wx.TextCtrl's scrollbar background colour? Thanks.
Posts: 21
Joined: Sat May 18, 2013 8:53 pm
Location: Computer

Re: [wxPython] change ScrollBar background colour.

Postby snippsat » Tue May 13, 2014 4:50 pm

Use SetBackgroundColour.
Code: Select all
import wx

class MyFrame(wx.Frame):
    def __init__(self, parent, mytitle, mysize):
        wx.Frame.__init__(self, parent, wx.ID_ANY, mytitle, size=mysize)
        self.panel = wx.Panel(self)
        self.panel.SetBackgroundColour('light blue')
        self.text_crtl = wx.TextCtrl(self.panel, value="", pos=(35,50))
        self.text_crtl.SetBackgroundColour((255,255,0)) #Yellow

app = wx.App()
MyFrame(None,'Test',(200, 200)).Show()

We will be moving to python-forum.io on October 1 2016
User avatar
Posts: 1251
Joined: Thu Feb 21, 2013 12:04 am

Return to GUI

Who is online

Users browsing this forum: No registered users and 1 guest