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

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个附件,已经成功下载615次)

最值得关注的外文源代码

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字内
请如实评论
本源代码共评论106次,此处显示最近20次评论! 查看所有评论

liuxuzhong  2017年03月02日
很好的东西,谢谢分享
glq  2015年09月11日
Thank you for your sharing
马晓婷  2015年03月30日
不太懂内部的原理
liufenghua  2014年11月13日
很想知道这是怎么做出来的啊?
nzd2007  2013年07月02日
快乐学习每一天
lxfangqie  2013年06月27日
很想看看怎么做界面来着
tiffany  2013年06月24日
下载学习一下
scsc4212  2013年05月08日
看看
杯中水DADA  2013年03月07日
先下载学习下
ippv@163.com  2013年01月29日
hao,henhao
zyq900408  2012年11月17日
谢谢分享
rulai  2012年10月28日
我喜欢
我是云  2012年10月10日
good
大川  2012年09月13日
ok
yongziqd  2012年09月11日
谢谢分享,学习了
qiuqiu  2012年09月06日
谢谢分享
猫小黑  2012年05月21日
谢谢分享
weiaichun  2012年04月07日
谢谢分享
primer  2012年03月12日
谢谢分享
linshl  2012年03月12日
非常感谢
字数在300字内
请如实评论
200万国内源码搜索
CopyRight (C) codesoso.com 2007-2009 All Rights Reserved zhihuishi   免责声明