当前位置:编程学习 > VB >>

如何text文本内容输入到PICTUREBOX里

VB  
想在PICTUREBOX里可以有文本的输入  就像TEXTCONTENT.text --------------------编程问答-------------------- Picture1.Print "ABCDE" --------------------编程问答-------------------- PICTUREBOX只能显示不能输入 --------------------编程问答-------------------- 1楼正解 --------------------编程问答-------------------- PictureBox本身并没有文本输入编辑的功能,建议你根据图片框的大小和位置,在相应的地方放上一个Text控件吧。平时隐藏,用的时候再显示。这样笨一点,不过最简单,否则用API实现起来还是个挺麻烦的事情。  --------------------编程问答-------------------- HDC dc=GetDC(Picture1.Handle);
TextOut(dc,0,0,"Hello World",11); --------------------编程问答--------------------
Private Declare Function GetDC Lib "user32.dll" (ByVal hwnd As Long) As Long
Private Declare Function TextOut Lib "gdi32.dll" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long

Private Sub Command1_Click()
Draw Picture1.hwnd
End Sub

Sub Draw(hwnd As Long)
Dim dc As Long
Dim ret As Long
dc = GetDC(hwnd)
ret = TextOut(dc, 0, 0, "Hello world", Len("Hello world"))
End Sub

--------------------编程问答-------------------- 一楼正解,6楼的更爽。 --------------------编程问答--------------------


 Picture1.CurrentX =0
 Picture1.CurrentY =0
 picture1.Print "Hello World!"

--------------------编程问答-------------------- 5楼正解,8楼正解,我来接分 --------------------编程问答-------------------- 为什么要GETDC()?
直接PICTURE1.HDC不行吗 --------------------编程问答--------------------
Private Sub Command1_Click()
    Picture1.CurrentX = 0
    Picture1.CurrentY = 0
    Picture1.Print Text1.Text
End Sub
--------------------编程问答-------------------- 有点难度哦
补充:VB ,  控件
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,