正在加载图片...
2)编写命令按钮的Cick事件代码 Private Sub Commandl click Dim a As string, text W as Integer, text As Integer FontName="隶书 输出文本的字体 FontSize=60 输出字体的大小 Fore Color=QBColor(15) 输出文本的前景色,即字体的颜色 Back color=QBColor(8) 输出文本的背景色,即窗体的颜色 a=“你好” 输出文本的内容 text w= Text Width(a)/2 文本的宽度 Text width(a) text= TextHeight(a)-Command 1 Height /2 CurrentX= Scale Width /2-textW 设置输出的水平位置 CurrentY= ScaleHeight /2-textH 设置输出的垂直位置 Print a 输出文本 End sub(2) 编写命令按钮的Click事件代码: Private Sub Command1_Click() Dim a As String, textW As Integer, textH As Integer FontName = "隶书" ' 输出文本的字体 FontSize = 60 ' 输出字体的大小 ForeColor = QBColor(15) ' 输出文本的前景色,即字体的颜色 BackColor = QBColor(8) ' 输出文本的背景色,即窗体的颜色 a = “你好” ' 输出文本的内容 textW = TextWidth(a) / 2 ' 文本的宽度TextWidth(a) textH = TextHeight(a) – Command1.Height / 2 CurrentX = ScaleWidth / 2 – textW ' 设置输出的水平位置 CurrentY = ScaleHeight / 2 – textH ' 设置输出的垂直位置 Print a ' 输出文本 End Sub
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有