C++ CButton showing only bitmap icon
<p>I'm using C++ on Visual Studio 2012 update 4, and I have a Dialog where I want to display a button showing a bitmap (.bmp file), without borders <a href="https://i.stack.imgur.com/YucA8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YucA8.png" alt="help icon"></a></p>

<p>I have extended <code>CButton</code> to add my tooltip, and so on.</p>

<p>Using the Resource View to open the Dialog <code>.rc</code> file, I set the button Property <code>Bitmap</code> to <code>true</code>. Then, from the Dialog <code>OnInitDialog</code> function, I used this code to set the bitmap, identified as <code>IDB_HELP</code></p>

<pre><code>myButton.SetBitmap((HBITMAP)LoadImage(AfxGetApp()-&gt;m_hInstance,
    MAKEINTRESOURCE(IDB_HELP), IMAGE_BITMAP, 16, 16, LR_COLOR));
</code></pre>

<p>But it displays this <a href="https://i.stack.imgur.com/XSfcI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XSfcI.png" alt="ugly button"></a> and I don't want that half-border.</p>

<p>I tried making it <code>Flat</code> and <code>Transparent</code> in the Resource View, but it only gets uglier.</p>

<p>Then I tried to only draw the image by setting <code>Owner Draw</code> to <code>true</code> and then redefining <code>DrawItem</code> in my button class, but I can't quite figure that out either.</p>

<p>Any easy way to make an icon-only button?</p>