Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1756097
  • 博文数量: 600
  • 博客积分: 10581
  • 博客等级: 上将
  • 技术积分: 6205
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-06 10:13
文章分类
文章存档

2016年(2)

2015年(9)

2014年(8)

2013年(5)

2012年(8)

2011年(36)

2010年(34)

2009年(451)

2008年(47)

分类:

2009-10-11 13:51:49

来源:cww

其实这是不可能一下子完成的,因为Alignment属性是唯读的,所以只好在Form中
使用三个TextBox来完成,Text1.Alignment = 0, Text2.Alignment = 1,
Text3.Alignment = 2,而且三者的MultiLine设为True。
并在Form中放三个Option Control,一开始Text2, Text3 Move到Text1的位置与大小,
而後看选择哪个Option会来决定何者Display出来,而达效果

Option Explicit

Private Sub Form_Load()

Text2.Visible = False
Text3.Visible = False
Text2.Move Text1.Left, Text1.Top, Text1.Width, Text1.Height
Text3.Move Text1.Left, Text1.Top, Text1.Width, Text1.Height
Text2.Text = Text1.Text
Text3.Text = Text1.Text
End Sub

Private Sub Option1_Click()
If Option1.Value = True Then
   Text1.Visible = True
   Text2.Visible = False
   Text3.Visible = False
End If

End Sub

Private Sub Option2_Click()
If Option2.Value = True Then
   Text2.Visible = True
   Text1.Visible = False
   Text3.Visible = False
End If

End Sub

Private Sub Option3_Click()
If Option3.Value = True Then
   Text3.Visible = True
   Text1.Visible = False
   Text2.Visible = False
End If

End Sub

Private Sub Text1_Change()
Text2.Text = Text1.Text
Text3.Text = Text1.Text
End Sub

Private Sub Text2_Change()
Text1.Text = Text2.Text
Text3.Text = Text2.Text

End Sub

Private Sub Text3_Change()
Text1.Text = Text3.Text
Text2.Text = Text3.Text

End Sub
 
阅读(780) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~