(That was directed at the OP).
Where are you shopping? I think you could find a LOT better deal than that.
Printable View
(That was directed at the OP).
Where are you shopping? I think you could find a LOT better deal than that.
Hi,
I use VS 2008 SP1.
made a new class CHot of the type CButton
made also the mouse handlers (leave, hover and move)
but how do I glue it to the desired button??
regards,
ger
What do you mean by "glue"? How are you using this button? In a CDialog? Just add a button the way you normally would in the resource editor, then right-click, add-variable, and type in your derived button class instead of CButton.
Hi,
That is what I did.
But when I change CButton in CHot (the one I created)
I have to fill in a variable as well, I put in dummy.
Pushing OK results in an error.
regards,
ger
Put in a dummy for what?
Should be like this:
http://hoxnet.com/cap1.jpg
Hi,
where can I find the variable(in your case m_Mybutton1), which I have to use?
or do I have to create one ....
regards,
ger
It will create it for you.
If your class, CHot is part of your project, then the class wizard will find it, include it's header, and add a variable with the name you give it. That's why it's called a wizard.
Hi,
unable to solve...
put my project in the Att.
regards,
ger
Since you are using a CBitmapButton, wouldn't it make sense to derive the CHot class from CBitmapButton?
In the CHOVERDlg header, the btnBmp is incorrectly declared from CBitmapButton. How do you expect to get the new overridden behavior of CHot if you don't declare a variable from CHot?
Hi Arjay,
downloaded your prog, THANKS !!
I do not fully understand the changes made, I will study them during the weekend.
will let You know.
Apart from that, how do I change the bitmap in the 'mouse handlers' in HOT.
I get the message "btnBmp" unknow.
regards,
ger
HI Arjay,
Did some homework.
a couple of thinks I do not fully understand.
I tested the att. things work as I want.
The only thing left is to change the button bitmap on hover and leave.
I tested the program leaving out the HOT.h and HOT.cpp
the mouse handlers react on the whole dialog, that I do understand.
this is not what I want, so I have to 'connect' the mouse handlers to the button instead.
We have to create a new class, called HOT. and attach it to the button.
understand that part as well.
So at this stage we have three classes called HOVER, HOVERDlg and HOT.
the Bitmap object is decleared in the HOVERDlg, called btnbmp
you commented the statement: CBitmapButton btnBmp;
and put in; CHot btnBmp;
I do not fully understand this.
I think you used the wizard also to "connct" the class to the bitmap-button.
you put in a variable name called; m_buttonhot.
and also put commented out the statement;
DDX_Control(pDX, IDC_BUTTON1, m_ButtonHot);
also this i do not fully understand.
Using calls like 'MessageBox(0,0,0) I know where the program is.
now I have to remove these Messages and change the the button image.
How do I make the chanege as the btnbmp is decleared in HOVERDlg and
is not know in CHOT.
That part, the interaction between the classes, is hard to get used to.
regards,
ger
Hi Guys,
FOUND IT !!!
was searching in the wong direction....
iso of redrawing the button I'm using the focus option!
in the mouse hover handler I use
PostMessage(WM_SETFOCUS, TRUE, 0);
and in the leave handler I use
PostMessage(WM_KILLFOCUS, TRUE, 0);
btw do I have to use sendmessage or postmessage??
yet I would like to have an answer on the two quest. in the previous post. (Please)
regards,
ger