1、如何在form上指定位置写字?例如在坐标为(100,100)的位置显示hello
2、当form画的线段变化后,原来的线段更新掉,显示当前的图画
不清楚的地方,我在线回答
2、当form画的线段变化后,原来的线段更新掉,显示当前的图画
不清楚的地方,我在线回答
解决方案 »
- 我开了几个IE窗口,我该怎样对当前网页进行操作(操作没问题)
- 快到圣诞了..散分!!
- [急问]怎么用vb实现在局域网中通过mac地址查找到该机的ip地址!
- 大家看看我的数据库连接有什么问题?
- 另一个问题,我安装了win2000 和 office2000,而软件连接的是 Access97,现在连接不上了如何解决???
- 怎样用Inet控件实现任意格式的文件下载?谁有漂亮一些的软件界面?
- 写二进制文件到注册表只能写类似Chr$(&H1) + Chr$(&H2) + Chr$(&H3) + Chr$(&H4)如何写以下文件?
- 请教个控件的用法
- 请问vb6 data report 如何使用呢!!谢谢
- 又是只要回答就有分?
- 在select语句中如何得到excel的某个单元格的值
- win98里关于sql2000链接报错的问题
form1.Currentx = 100
form1.Currenty = 100
form1.print "hello"2.
form1.cls(不知是不是这样,没太明白)
form.CurrentY=100
form.Print "hello"
(2)form.cls
call DrawLine()
Public Const DT_CALCRECT = &H400
Public Const DT_CENTER = &H1
Public Const DT_EXPANDTABS = &H40
Public Const DT_EXTERNALLEADING = &H200
Public Const DT_LEFT = &H0
Public Const DT_NOCLIP = &H100
Public Const DT_NOPREFIX = &H800
Public Const DT_RIGHT = &H2
Public Const DT_SINGLELINE = &H20
Public Const DT_TABSTOP = &H80
Public Const DT_TOP = &H0
Public Const DT_VCENTER = &H4
Public Const DT_WORDBREAK = &H10Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End TypeType SIZE
cx As Long
cy As Long
End TypeDeclare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hDC As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long
Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (ByVal hDC As Long, ByVal lpsz As String, ByVal cbString As Long, lpSize As SIZE) As Long
放在form:
Option ExplicitConst LongStr = "Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the lpRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text."Private Sub Command1_Click()
Dim r As RECT, s As SIZE
r.Left = 50: r.Top = 20
DrawText Me.hDC, "Draw Text Test", 14, r, DT_CALCRECT
Line (r.Left, r.Top)-(r.Right, r.Bottom), RGB(255, 255, 0), BF
DrawText Me.hDC, "Draw Text Test", 14, r, 0
r.Left = 50: r.Top = 50: r.Right = 300
DrawText Me.hDC, LongStr, Len(LongStr), r, DT_CALCRECT Or DT_WORDBREAK
Line (r.Left, r.Top)-(r.Right, r.Bottom), RGB(255, 255, 0), BF
DrawText Me.hDC, LongStr, Len(LongStr), r, DT_WORDBREAK
End Sub