Originally posted by: soy
I've tried to repair the point..
I used CHoverButton very useful..
to repaire the point..
in 'hovbuttDlg.cpp'
in this class..
int CHovbuttDlg::RefreshButtons(int nSelected /*=0*/ )
add "Invalidate();"
before "return nSelected;" statement
It's very simple but I tried all day..^^
Have nice day~
Originally posted by: Jeff
Hello, I have a dialog with a background picture. The hover buttons won't show up until I hover the mouse over top of them. How can I get them to show up right away?
Note that with normal buttons I just set the tab order so that the buttons are last, but the hover buttons don't work like this.
Thanks,
Jeff.
Originally posted by: Henry Park
I'm having a bit of trouble getting the tooltip text to appear. I'm building an ActiveX control that utilizes "hover" and "tooltips". The hover aspect works fine, but, the tooltip text does not appear. If anyone is interested in helping me, I'll send some code.
Thanks...
ReplyOriginally posted by: Isaac Eckert
Try creating a Bitmap Button were the Disabled state is when most is not over the button and the Enabled state is when it is over the button. After creating the button, position it where you wish and disable it. When the button is disabled all OnMouseMove messages go to the parent window instead of the button. You can then test the position of the mouse in the window to see if it is over the button. Then enable the button to be clicked. When the mouse moves out of the area it will receive the OnMouseMove message and you can disable the button. It is easier to test for rectangler regions but with a little math any region can be tested for. Use the SetWindowRgn fuction in vc++ to shape the button. The only bug is that if you move into another window without sending a OnMouseMove message, the button stays enabled until the mouse is moved back.
ReplyOriginally posted by: Ranjanie
Please also intimate me that how to create hoverbutton in Visual Basic 6.0.
Originally posted by: Hamid Yaseen
Hello Dear
Your class has a main error whose senario is as
"
At a time there is only one button is on and all other buttons are off. Take mouse over any off state button with left button Down and then leave the left button.It will calls left button up. In this way the two radio buttons become on. Which is wrong.
"
Hamid Yaseen
Originally posted by: sten struikenkamp
Hi Will,
I like your radio Hoverbutton class.
It works fine !
Thanks !
I only noticed that setting the background color of the bitmaps
to (192,192,192) works fine in W98 but not in W2000.
The 'COLOR_BTNFACE' is diferent !
W2000 -> (212,208,200)
The difference is not much, but you can still see it on your dialog.
I replaced your 'BitBlt' with the code below for 'transparent bit blitting'.
'TransparentBlt' however, only works for W98 and W2000.
You can use any transparent color for your bitmap background, but i suggest
you use (200,200,200) so that the code will also work for W95/NT4.0 (?).
(I only have W98/W2000, so I could not test it for W95/NT4.0).
The code below uses pixel(0,0) to get the transparent color.
The transparent color must not exist in your button image !
For example, if you use 'magenta' for your background, magenta must not exist
in the button image. Otherwise the (lightgray) underground will shine through.
CDC dcTemp;
CBitmap bmpTemp, *bmpOldTemp;
dcTemp.CreateCompatibleDC(pDC);
bmpTemp.CreateCompatibleBitmap(pDC,rc.Width(),rc.Height());
bmpOldTemp = dcTemp.SelectObject(&bmpTemp);
dcTemp.FillSolidRect(&rc,GetSysColor(COLOR_BTNFACE));
// (212,208,200) Win2000
// (192,192,192) Win98
dcTemp.BitBlt(0, 0, rc.Width(), rc.Height(), &memDC,
0, 0, SRCCOPY);
COLORREF clrTransparent = dcTemp.GetPixel(0,0);
// TransparentBlt only for Win2000 and Win98
if( !TransparentBlt(pDC->GetSafeHdc(),
0,0,rc.Width(),rc.Height(),
dcTemp.GetSafeHdc(),
0,0,rc.Width(),rc.Height(),
clrTransparent) )
{
if(!pDC->BitBlt(0, 0, rc.Width(), rc.Height(), &memDC,
0, 0, SRCCOPY))
return;
}
dcTemp.SelectObject(bmpOldTemp);
note: use msimg32.dll/msimg32.lib
Thanks again !
Hope this helps...
Sten Struikenkamp
The Netherlands
the statement '!TransparentBlt' (note the .not.) will probably not work
in W95/NT4.0. This was done to give 'BitBlt' a chance to do the work.
But there must be a way to figure out if the function is available in W95/NT4.0.
I have seen such a piece of code somewhere, but i cannot remember...
Reply
Originally posted by: miki
what if i have to add a tip to my button on the head of the mouse pointer ??
uptill now i hav seen only tooltips but not a button tip help anywhere ??
should i add a ? button on the sys menu bar and then create a .hlp file for it ??
any other way of doin the same thing ??
Originally posted by: Dark Mage
void CHoverButton::OnLButtonUp(UINT nFlags, CPoint point)
void CHoverButton::OnLButtonDown(UINT nFlags, CPoint point)
*DM*
I managed to change a few things to get the code changned
for a regular Button (not radio). However, it doesn't
want respond to the first CLICK of the button for some reason? Here's the main area I changed:
{
OnMouseEnter();
CBitmapButton::OnLButtonUp(nFlags, point);
}
{
SetButtonState(BUTTON_ON); //Highlight button
CBitmapButton::OnLButtonDown(nFlags, point);
}
Any idea why the button doesn't respond to the first
click? And why it would respond perfectly every time there
after?
Originally posted by: abhishek
if i have to insert bitmap from my resource collection using its Id...what to do then ?
abhi
Reply