分类:
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 |