<html xmlns="http://www.w3.org/1999/xhtml" a0:Name="SuikaWiki" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:Version="0.9"><head></head><body><p><a0:anchor-end a0:anchor="1">[1]</a0:anchor-end> <a0:anchor>VB</a0:anchor> 6 以前では、色は<a0:anchor>長整数型</a0:anchor>の数値で表されていました。
16進数で <code class="VB">&amp;H00<var>BB</var><var>GG</var><var>RR</var>&amp;</code>
のように表せます。順序が RGB
ではなく BGR であることに注意が必要です。</p><p>また、<a0:anchor>システム色</a0:anchor>の定数も定義されており、
その値はより大きな数から選ばれていました。</p><p><a0:anchor-end a0:anchor="2">[2]</a0:anchor-end> <a0:anchor>VB.NET</a0:anchor> ではこの辺もがらりと変わっています。
参考:
<a0:anchor-external a0:resScheme="URI" a0:resParameter="http://www.microsoft.com/japan/msdn/library/default.asp?url=/japan/msdn/library/ja/Vbcon/html/vberrcolorchangesinvisualbasicnet.asp">http://www.microsoft.com/japan/msdn/library/default.asp?url=/japan/msdn/library/ja/Vbcon/html/vberrcolorchangesinvisualbasicnet.asp</a0:anchor-external></p><p><a0:anchor-end a0:anchor="3">[3]</a0:anchor-end>
色定数は<a0:anchor>基本16色</a0:anchor>に対して割り当てられています。</p><table><tbody><tr><th>VB6 以前の定数名</th><th>値</th><th>VB.NET の定数名</th></tr><tr><td>vbBlack</td><td></td><td>System.Drawing.Color.Black</td></tr><tr><td>vbRed</td><td></td><td>System.Drawing.Color.Red</td></tr><tr><td>vbGreen</td><td></td><td>System.Drawing.Color.Lime</td></tr><tr><td>vbYellow</td><td></td><td>System.Drawing.Color.Yellow</td></tr><tr><td>vbBlue</td><td></td><td>System.Drawing.Color.Blue</td></tr><tr><td>vbMagenta</td><td></td><td>System.Drawing.Color.Magenta</td></tr><tr><td>vbCyan</td><td></td><td>System.Drawing.Color.Cyan</td></tr><tr><td>vbWhite</td><td></td><td>System.Drawing.Color.White</td></tr><tr><td>vb3DDKShadow</td><td>&amp;H80000015</td><td>System.Drawing.SystemColors.ControlDarkDark</td></tr><tr><td>vb3DFace</td><td></td><td>System.Drawing.SystemColors.Control</td></tr><tr><td>vb3DHighlight</td><td>&amp;H80000014</td><td>System.Drawing.SystemColors.ControlLightLight</td></tr><tr><td>vb3DLight</td><td>&amp;H80000016</td><td>System.Drawing.SystemColors.ControlLight</td></tr><tr><td>vb3DShadow</td><td></td><td>System.Drawing.SystemColors.ControlDark</td></tr><tr><td>vbActiveBorder</td><td>&amp;H8000000A</td><td>System.Drawing.SystemColors.ActiveBorder</td></tr><tr><td>vbActiveTitleBar</td><td>&amp;H80000002</td><td>System.Drawing.SystemColors.ActiveCaption</td></tr><tr><td>vbActiveTitleBarText</td><td>&amp;H80000009</td><td>System.Drawing.SystemColors.ActiveCaptionText</td></tr><tr><td>vbApplicationWorkspace</td><td>&amp;H8000000C</td><td>System.Drawing.SystemColors.AppWorkspace</td></tr><tr><td>vbButtonFace</td><td>&amp;H8000000F</td><td>System.Drawing.SystemColors.Control</td></tr><tr><td>vbButtonShadow</td><td>&amp;H80000010</td><td>System.Drawing.SystemColors.ControlDark</td></tr><tr><td>vbButtonText</td><td>&amp;H80000012</td><td>System.Drawing.SystemColors.ControlText</td></tr><tr><td>vbDesktop</td><td>&amp;H80000001</td><td>System.Drawing.SystemColors.Desktop</td></tr><tr><td>vbGrayText</td><td>&amp;H80000011</td><td>System.Drawing.SystemColors.GrayText</td></tr><tr><td>vbHighlight</td><td>&amp;H8000000D</td><td>System.Drawing.SystemColors.Highlight</td></tr><tr><td>vbHighlightText</td><td>&amp;H8000000E</td><td>System.Drawing.SystemColors.HighlightText</td></tr><tr><td>vbInactiveBorder</td><td>&amp;H8000000B</td><td>System.Drawing.SystemColors.InactiveBorder</td></tr><tr><td>vbInactiveCaptionText</td><td></td><td>System.Drawing.SystemColors.InactiveCaptionText</td></tr><tr><td>vbInactiveTitleBar</td><td>&amp;H80000003</td><td>System.Drawing.SystemColors.InactiveCaption</td></tr><tr><td>vbInactiveTitleBarText</td><td>&amp;H80000013</td><td>System.Drawing.SystemColors.InactiveCaptionText</td></tr><tr><td>vbInfoBackground</td><td>&amp;H80000018</td><td>System.Drawing.SystemColors.Info</td></tr><tr><td>vbInfoText</td><td>&amp;H80000017</td><td>System.Drawing.SystemColors.InfoText</td></tr><tr><td>vbMenuBar</td><td>&amp;H80000004</td><td>System.Drawing.SystemColors.Menu</td></tr><tr><td>vbMenuText</td><td>&amp;H80000007</td><td>System.Drawing.SystemColors.MenuText</td></tr><tr><td>vbScrollBars</td><td>&amp;H80000000</td><td>System.Drawing.SystemColors.Scrollbar</td></tr><tr><td>vbTitleBarText</td><td></td><td>System.Drawing.SystemColors.ActiveCaptionText</td></tr><tr><td>vbWindowBackground</td><td>&amp;H80000005</td><td>System.Drawing.SystemColors.Window</td></tr><tr><td>vbWindowFrame</td><td>&amp;H80000006</td><td>System.Drawing.SystemColors.WindowFrame</td></tr><tr><td>vbWindowText</td><td>&amp;H80000008</td><td>System.Drawing.SystemColors.WindowText</td></tr></tbody></table><p><a0:anchor-end a0:anchor="5">[5]</a0:anchor-end> <a0:anchor>システム色</a0:anchor>は <a0:anchor>Windows</a0:anchor>
のものですから、 <a0:anchor>CSS</a0:anchor>
の<a0:anchor>システム色</a0:anchor>ともほぼそのまま対応します。<ul><li><a0:anchor-end a0:anchor="6">[6]</a0:anchor-end> VB.NET では色を表す <a0:anchor>class</a0:anchor> が用意されているので、それを使います。</li><li><a0:anchor-end a0:anchor="7">[7]</a0:anchor-end> <a0:anchor-internal a0:anchor="3">&gt;&gt;3</a0:anchor-internal> で色定数値を書いてないところは重複。</li><li><a0:anchor-end a0:anchor="8">[8]</a0:anchor-end> OjColor HTML と Visual Basic の色の作成・指定支援ツール  <a0:anchor-external a0:resScheme="URI" a0:resParameter="http://www.vector.co.jp/soft/win95/net/se104057.html">http://www.vector.co.jp/soft/win95/net/se104057.html</a0:anchor-external></li></ul></p><figure class="amazon"><p><a0:anchor>Visual Basic</a0:anchor></p></figure></body></html>