// MySlider.cpp : implementation file
//
#include "stdafx.h"
#include "MpegImage.h"
#include "MySlider.h"
#include "MpegImageDlg.h"
#include <math.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMySlider
CMySlider::CMySlider()
{
type=0;
}
CMySlider::~CMySlider()
{
}
BEGIN_MESSAGE_MAP(CMySlider, CSliderCtrl)
//{{AFX_MSG_MAP(CMySlider)
ON_WM_LBUTTONDOWN()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMySlider message handlers
void CMySlider::OnLButtonDown(UINT nFlags, CPoint point)
{
CSliderCtrl::OnLButtonDown(nFlags, point);
CRect rect;
GetClientRect(rect);
int nMin = 0;
int nMax = 0;
GetRange(nMin, nMax);
// CString str;
// str.Format("(%d,%d)",nMin,nMax);
// MessageBox(str);
point.x=point.x-rect.left;
int pos = nMin + (nMax-nMin) * point.x / (rect.Width()-5);
SetPos(pos);
// CString str;
// str.Format("%d",pos);
// MessageBox(str);
}
没有合适的资源?快使用搜索试试~ 我知道了~
Slider鼠标点击 滑块移动
共2个文件
cpp:1个
h:1个
4星 · 超过85%的资源 需积分: 28 55 下载量 4 浏览量
2011-08-16
11:23:21
上传
评论
收藏 1KB RAR 举报
温馨提示
Slider鼠标点击 滑块移动 滑块位置 Slider鼠标点击 滑块移动 滑块位置。实现鼠标点击Slider 实现滑块移动到鼠标单击的位置
资源推荐
资源详情
资源评论
收起资源包目录
myslider.rar (2个子文件)
myslider
MySlider.cpp 1KB
MySlider.h 1KB
共 2 条
- 1
毒来毒往
- 粉丝: 36
- 资源: 39
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页