Private Sub Command1_Click() CommonDialog1.Filter = "Jpg (*.JPG)|*.JPG|BMP(*.BMP)|*.BMP" CommonDialog1.ShowOpen If CommonDialog1.filename <> "" Then Image1.Picture = LoadPicture(CommonDialog1.filename) End If End Sub
用label吧 Private Sub Form_Load() Text1.Visible = False End SubPrivate Sub Label1_Click() Text1.Move Label1.Left, Label1.Top, Label1.Width, Label1.Height Text1.Visible = True Text1.SetFocus End Sub
CommonDialog1.Filter = "Jpg (*.JPG)|*.JPG|BMP(*.BMP)|*.BMP"
CommonDialog1.ShowOpen
If CommonDialog1.filename <> "" Then
Image1.Picture = LoadPicture(CommonDialog1.filename)
End If
End Sub
用richtextbox也不可以吗?
但是我不可能用label呀,不然别的功能不能实现啦
如果要把textbox改成label我好多东西都得改
而且我还没有找到那个透明的属性
SetWindowLong设置RichTextbox为WS_EX_LAYERED
然后SetLayeredWindowAttributes,指定LWA_COLORKEY。
搞定。或者,一定要用Textbox的话,我前年写过一个小例子,参见
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=22549&lngWId=1但是这个例子只能用于参考,在不同的系统上表现不稳定。
Private Sub Form_Load()
Text1.Visible = False
End SubPrivate Sub Label1_Click()
Text1.Move Label1.Left, Label1.Top, Label1.Width, Label1.Height
Text1.Visible = True
Text1.SetFocus
End Sub