模拟滚动条(带皮肤)

时间:2012-11-29 07:01:28
【文件属性】:

文件名称:模拟滚动条(带皮肤)

文件大小:38KB

文件格式:RAR

更新时间:2012-11-29 07:01:28

scrollbar 皮肤

m_Startpt = point; //确定滚动区域 CRect rcScroll = m_ClientRect; rcScroll.left += m_ThumbWidth; rcScroll.right-= m_ThumbWidth; DWORD wparam; SetCapture(); if (m_ThumbRect.PtInRect(point)) { m_ButtonDown = TRUE; } else if (rcScroll.PtInRect(point)) //单击滚动区域 { CPoint centerPt = m_ThumbRect.CenterPoint(); int offset = point.x-centerPt.x; if ((int)point.xm_ThumbRect.right) m_IsRightRange= TRUE; m_ThumbRect.OffsetRect(offset,0); int left = m_ThumbRect.left; int right = m_ThumbRect.right; if (left<(int)m_ThumbWidth) //判断当前滚动量是否超出了滚动范围 { int width = m_ThumbRect.Width(); m_ThumbRect.left = m_ThumbWidth; m_ThumbRect.right = m_ThumbRect.left+width; m_CurPos = /*m_MinRange*/(point.x-m_ThumbWidth)*m_Rate; wparam = MAKELONG(SB_PAGELEFT,m_CurPos) ; ::SendMessage(GetParent()->m_hWnd,WM_HSCROLL,wparam,(LPARAM)m_hWnd); DrawControl(); return; } else if (right>(int)(m_ClientRect.Width()-m_ThumbWidth)) { int width = m_ThumbRect.Width(); m_ThumbRect.right = m_ClientRect.Width()-m_ThumbWidth; m_ThumbRect.left = m_ThumbRect.right -width; m_CurPos = m_MaxRange; wparam = MAKELONG(SB_PAGERIGHT,m_CurPos); ::SendMessage(GetParent()->m_hWnd,WM_HSCROLL,wparam,(LPARAM)m_hWnd); DrawControl(); return; }


【文件预览】:
Skin
----Skin.rc(7KB)
----Skin.sln(873B)
----StdAfx.cpp(206B)
----resource.h(2KB)
----Skin.vcproj.YAO.Administrator.user(1KB)
----SkinDlg.cpp(7KB)
----Skin.plg(3KB)
----CustomScroll.h(3KB)
----Skin.h(1KB)
----Skin.dsw(533B)
----ReadMe.txt(3KB)
----StdAfx.h(1KB)
----Skin.dsp(5KB)
----Skin.cpp(2KB)
----Skin.suo(13KB)
----SkinDlg.h(2KB)
----Skin.clw(2KB)
----res()
--------Gchanelbk.bmp(9KB)
--------Bleftarrow.bmp(888B)
--------Skin.rc2(396B)
--------GleftArrow.bmp(888B)
--------2.bmp(5KB)
--------RedBK.bmp(9KB)
--------Bchanelbk.bmp(9KB)
--------RedThumb.bmp(5KB)
--------redleft.bmp(888B)
--------RedRight.bmp(888B)
--------chanel.bmp(4KB)
--------017.bmp(990B)
--------GrightArrow.bmp(888B)
--------Skin.ico(1KB)
--------Brightarrow.bmp(888B)
--------bitmap3.bmp(4KB)
--------Bthumb.bmp(5KB)
--------Gthumb.bmp(5KB)
----CustomScroll.cpp(10KB)
----Skin.vcproj(9KB)
----Skin.aps(101KB)

网友评论

  • 很不错的程序,谢谢分享