当前注册人数155278人 邮箱: 密码: 注册新用户 忘记密码
首页 C/C++/MFC C# ASP.NET VB.NET MATLAB   站内搜索 BBS讨论社区 下载代码说明/积分规则
为什么要注册?

1. 可以直接免费从本站下载代码,防止邮件发送不到您的邮箱,或登录不了国外网站

2. 可以设定关键字,当有您关心的代码收录时,邮件通知您

3. 对这里的代码进行评分和评论

4. 可以和大家一起分享你的源代码,得到更多的建议

Owner-draw icon buttons in plain C (no MFC)

纯C语言开发的图标/图片按钮源代码

2008年01月17日
C++, C, VC7, Windows, WinXP, VS, MFC, VS.NET2003, Dev
这个图标/图片按钮是用纯C语言开发的,而不是MFC;MFC确实提供了很多的类供大家使用,不过,如果你在使用Win32的API呢?这个程序中使用了字体font, 绘制形状shape, 绘制边edge, 绘制颜色color, 使用刷子brush 和钢笔pen完成。
 
相关知识
switch(message) {
    case WM_DRAWITEM:
        pdis = (DRAWITEMSTRUCT*) lParam;
        switch(pdis->CtlID) {
            case IDC_LEVELUPBUTTON:
                // Fall through (you would use a "break" otherwise):

            case IDC_LEVELDNBUTTON:
                iResult = myManageOwnerDrawIconButton(pdis, hInst);
                if (RET_OK != iResult) return(FALSE);
                break;
            default:
                break;
        }
        return(TRUE);
// ...
源代码原文下载:
Owner-draw icon buttons in plain C (no MFC) Although Windows has a really cool GUI, sometimes the way standard buttons look quite does not meet our requirements. We may then choose buttons with a style called "owner-draw". The owner has to draw the button in every aspect (background, border, text, image) of every situation that requires drawing (click, enable, focus, etc.).It took me days to come up with something functional, Now here is some simple, reliable code: if it proves useful I will write something about owner-draw buttons with text (dealing with fonts, shapes, edges, colorrefs, brushes and pens).

源码图片

从本站下载附件及源代码(1个附件,已经成功下载254次)

最值得关注的外文源代码

SuperGrid - Yet Another listview control
XPTable - .NET ListView meets Java's JTable
malic: A Realtime Face Recognition System Source Code
Adding a Status Bar Pane to an Internet Explorer Window and Unmasking the Web Page Passwords in Place
评论(评论是增加积分的一个有效途径)
字数在300字内
请如实评论
本源代码共评论52次,此处显示最近20次评论! 查看所有评论

adamusi  2010年05月05日
学习学习
sunsocool  2010年03月05日
好好
特务小强  2010年01月25日
学习学习
skyforleave  2009年12月05日
高手!
poopsun  2009年09月26日
看看...
Fairy Topia  2009年06月04日
试试看~~
ql  2009年04月25日
Thanks a lot!
hexuan8441  2009年04月15日
研究
wjn  2009年04月04日
先研究一翻
新手1  2009年03月24日
学习一下
xiaoyaojun  2009年03月04日
不错不错
cqpkcool  2009年02月16日
很好
飞翔  2008年12月03日
怎么下载啊
guanrb8635  2008年11月05日
看看
usb  2008年11月02日
谢谢了
McGrady  2008年10月28日
很喜欢很喜欢
vas  2008年10月25日
可以说,codesoso上的东西绝对值得学习!
akailovexp  2008年10月12日
喜欢最初的编程。。。
hangsome  2008年10月09日
很喜欢很喜欢
liangwind  2008年10月07日
怎么下载呀
字数在300字内
请如实评论
CopyRight (C) codesoso.com 2007-2009 All Rights Reserved   免责声明
京ICP备08011023号