Advertisement
Java_Volume1 Coding Standards #93173

Command Button - Change Forecolor (Trick!)

Ever wanted to give your boring Command Buttons a different text color? Here's your chance ;)

AI

KI-Zusammenfassung: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Quellcode
original-source
<div align="left">
 <table border="0" cellpadding="0" cellspacing="0" width="490" height="75">
 <tr>
  <td width="490" height="20" valign="top">
&nbsp;<br><b>
  <font face="Verdana" size="2" color="#FF0000">Change the forecolor of a 
  "Command Button"...</font></b></td>
 </tr>
 <tr>
  <td width="490" height="48" valign="top"><font face="Verdana" size="2">1) 
  Add a check-box on your form and rename it to "Command1"<br>
  2) Set it style-property to "1 - Graphical"<br>
  3) Add the following code to "Command1_MouseUp"...</font></td>
 </tr>
 <tr>
  <td width="490" height="4" valign="top">
  <hr noshade color="#000000" align="left"></td>
 </tr>
 <tr>
  <td width="490" height="1" valign="top">
  <font face="Verdana" style="font-size: v" size="2">Command1.Value = 0</font></td>
 </tr>
 <tr>
  <td width="490" height="10" valign="top">
  <hr noshade color="#000000" align="left"></td>
 </tr>
 <tr>
  <td width="490" height="19" valign="top"><font face="Verdana" size="2">Of 
  course you could also use the hard-way, But I'd prefer this way.<br>
  A check-box supports the same events anyway...</font><p>
  <font face="Verdana" size="2">I hope you liked this small trick.<br>
  Kevin,</font></td>
 </tr>
 </table>
</div>
Originalkommentare (3)
Wiederhergestellt von der Wayback Machine