# -*- coding: utf-8 -*-
"""
Created on Sun Dec 30 13:09:42 2018
QQ群:476842922(欢迎加群讨论学习)
@author: Administrator
"""
#coding:utf-8
import wx
class Mywin(wx.Frame):
def __init__(self, parent, title):
super(Mywin, self).__init__(parent, title = title,size = (350,250))
panel = wx.Panel(self)
vbox = wx.BoxSizer(wx.VERTICAL)
hbox1 = wx.BoxSizer(wx.HORIZONTAL)
self.t1 = wx.TextCtrl(panel)
self.t1.SetBackgroundColour('Black'), self.t1.SetForegroundColour('Steel Blue')
self.SetTransparent(200)
hbox1.Add(self.t1,1,wx.EXPAND|wx.ALIGN_LEFT|wx.ALL,5)
self.t1.Bind(wx.EVT_TEXT,self.OnKeyTyped)
vbox.Add(hbox1)
panel.SetSizer(vbox)
self.Centre()
self.Show()
self.Fit()
def OnKeyTyped(self, event):
print(event.GetString())
app = wx.App()
Mywin(None, 'TextCtrl demo')
app.MainLoop()
textCtrl 透明窗口 输入打印字符
最新推荐文章于 2022-09-03 13:47:19 发布