Archived

This topic is now archived and is closed to further replies.

Rounded button problem

This topic is 5026 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m trying to create a rounded box button (sorry bout my lack of knowledge bout MFC) and I followed this tutorial in creating a ownerdrawn button. The results looks great but there''s only one flaw, even my button is now not a box, on each corner of the button there''s always a white/gray space. I think is because the button area is always a box and it looks bad if I place my button on top of image/color. How can I eliminate the those spaces in the corner of my button. Thkx

Share this post


Link to post
Share on other sites
I don''t have any code in front of me to look up the exact calls, but if I remember correctly you need to create clipping regions. I think there''s even a roundrect region function to create rounded off rectangles. Just do a search in the docs for regions and that should hook ya up

-John

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Here is the easiest way that i know, to randomize a number.



#include <iostream>
#include <time.h>
using namespace std;

int main() {

srand(time(0));
int rNum
rNum = 1 + rand() % 10 // whereas 1 is the low-range
// and 10 i the high-range number
return 0;
}


Now, although this does produce randome numbers, it randomizes off of the timer. In other words, if you were to put the rand statement into a loop, it would generate a new random number about every second.

Share this post


Link to post
Share on other sites
quote:
Original post by yanuart
I''m trying to create a rounded box button (sorry bout my lack of knowledge bout MFC) and I followed this tutorial in creating a ownerdrawn button.
The results looks great but there''s only one flaw, even my button is now not a box, on each corner of the button there''s always a white/gray space.
I think is because the button area is always a box and it looks bad if I place my button on top of image/color. How can I eliminate the those spaces in the corner of my button.
Thkx
You, my friend, must not read tutorials that teach you how to create an ownerdrawn button, but read tutorials that teach you how to create ownerdrawn controls.

Share this post


Link to post
Share on other sites