| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 640 人关注过本帖
标题:窗体问题,高手帮忙看一下
只看楼主 加入收藏
anycall628
Rank: 1
等 级:新手上路
帖 子:222
专家分:0
注 册:2005-2-18
收藏
 问题点数:0 回复次数:2 
窗体问题,高手帮忙看一下
以下代码是我照着书上编的,但是运行后没有显示出应该的效果,应该显示一个字体窗口 VB6 ,可是没有显示出来,高手帮忙看一下,那里有问题,代码如下

Private Declare Function BeginPath Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long, ByVal nBkMode As Long) As Long
Private Declare 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
Private Declare Function EndPath Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function PathToRegion Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function CreateFont Lib "gdi32" Alias "CreateFontA" (ByVal H As Long, ByVal W As Long, ByVal E As Long, ByVal O As Long, ByVal W As Long, ByVal I As Long, ByVal u As Long, ByVal S As Long, ByVal C As Long, ByVal OP As Long, ByVal CP As Long, ByVal Q As Long, ByVal PAF As Long, ByVal F As String) As Long
Private Const OPAQUE = 2
Private Const TRANSPARENT = 1
Private Const ANSI_CHARSET = 0
Private Const FW_HEAVY = 900
Private Const OUT_DEFAULT_PRECIS = 0
Private Const CLIP_DEFAULT_PRECIS = 0
Private Const DEFAULT_QUALITY = 0
Private Const DEFAULT_PITCH = 0
Private Const FF_SWISS = 32
Private Sub Form_Load()
Dim dc As Long
Dim m_wndRgn As Long
Dim m_Font As Long
Dim m_OldFont As Long
dc = Me.hdc
m_Font = CreateFont(200, 90, 0, 0, FW_HEAVY, 1, 0, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH Or FF_SWISS, "ËÎÌå")
BeginPath dc
SetBkMode dc, TRANSPARENT
m_OldFont = SelectObject(dc, m_Font)
TextOut dc, 0, 0, "VB6", 3
SelectObject dc, m_OldFont
EndPath dc
m_wndRgn = PathToRegion(dc)
SetWindowRgn Me.hWnd, m_w_wndrgn, True
End Sub
搜索更多相关主题的帖子: 窗体 
2005-05-26 21:54
griefforyou
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:3336
专家分:0
注 册:2004-4-15
收藏
得分:0 
SetWindowRgn Me.hWnd, m_w_wndrgn, True -> SetWindowRgn Me.hWnd, m_wndrgn, True

天津网站建设 http://www./
2005-05-27 00:11
anycall628
Rank: 1
等 级:新手上路
帖 子:222
专家分:0
注 册:2005-2-18
收藏
得分:0 
谢谢斑主了

爱生活,爱编程。
2005-05-29 20:39
快速回复:窗体问题,高手帮忙看一下
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018086 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved