⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 color_button.shtml

📁 mfc资源大全包含MFC编程各个方面的源码
💻 SHTML
字号:
<HTML>

<!-- Header information-->
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="Author" CONTENT="Chris Maunder">
   <TITLE>Controls - Colored buttons</TITLE>
</HEAD>

<!-- Set background properties -->
<body background="../fancyhome/back.gif" bgcolor="#FFFFFF" link="#B50029" vlink="#8E2323" alink="#FF0000">

<!-- A word from our sponsors... -->
<table WIDTH="100%">
<tr WIDTH="100%"><td align=center><!--#exec cgi="/cgi/ads.cgi"--><td></tr>
</table>


<!-- Article Title -->
<CENTER><H3><FONT COLOR="#AOAO99">
Colored buttons
</FONT></H3></CENTER>
<CENTER><H3><HR></H3></CENTER>

<!-- Author and contact details -->
This article was contributed by <A HREF="mailto:ryan@ma.aonix.com">Bob Ryan</A>.

<!-- Sample image and source code/demo project -->
<P>
Download <A HREF="color_button.zip">Source Code (3Kb)</A> and <A HREF="color_button_demo.zip">Demo Project (13Kb)</A>
</p>
<br>

<!-- The article... -->

<p>One of the problems with the Windows architecture is in the inability to draw buttons 
in a color other than gray. While the class offered here isn抰 cutting-edge technology,
it is something that a lot of people ask for and use (especially in multi-media applications).
The only way to draw the buttons in color is to use the owner-draw capabilities (or 
create a bitmap button which is a horrible solution). CColorButton does all this behind 
the scene and allows the developer to:</P>

<UL>
	<LI>Draw a button in DevStudio's editor for placement, size, and setting button captions. </LI>
	<LI>Set the foreground color (text color), background (button color), and disabled color 
	    (Note: the focus rectangle is drawn in the text color). </LI>
	<LI>Set the bevel width</LI>
</UL>

<P>Consider this simple dialog, displayed in the first example with light blue buttons and 
blue text and in the second example, with multiple colored buttons and different text colors:
<I>Note</I>: CTLCOLOR changes the background but not the buttons):</P>

<P><IMG SRC="color_button1.jpg" WIDTH=401 HEIGHT=236></P>
<P><IMG SRC="color_button2.jpg" WIDTH=401 HEIGHT=236></P>

<h4>Operations</h4>
<P>There is only one function, <tt>Attach()</tt>, which initializes an owner-draw button 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -