如何得到slider控件的ID值?

阿尔发go 2011-08-19 05:29:43
我在一个窗口里建立了两个水平方向的slider控件,ID值分别是"IDC_SLIDER1","IDC_SLIDER2",
当其中一个slider反生水平滑动时都会得到一个WM_WM_HSCROLL消息,如何判断这个消息是那个slider控件触发的?

希望高人可以指点,谢谢!
...全文
137 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
BoredNight 2011-08-23
  • 打赏
  • 举报
回复
楼上的。。什么贴都mark啊。。
AlanBruce 2011-08-23
  • 打赏
  • 举报
回复
Mark!
至善者善之敌 2011-08-19
  • 打赏
  • 举报
回复
相应
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
消息函数即可
TwoPanels是管理俩个页面间切换的件,俩个页面间既可以水平排列也可垂直排列。俩个页面都是Fragment,中间有个slider,负责制俩个页面的切换。通常他把左页面或垂直排列的上页面都叫左(left)页面, 把右页面或垂直排列的下页面都叫右(right)页面。项目地址:https://github.com/DesarrolloAntonio/TwoPanels 效果图:如何使用让你的Activity继承自TwoPanelsBaseActivitypublic class MainActivity extends TwoPanelsBaseActivity {2. 设置左、右页面以及设置参数setBaseOrientation(LinearLayout.HORIZONTAL);//设置俩个页面的排列方式,水平还是垂直 MyRightFragment mRightFragment = new MyRightFragment();//右页面,这个Fragment你需要自定义 MyLeftFragment mLeftFragment = new MyLeftFragment(); getFragmentManager().beginTransaction().add(R.id.right, mRightFragment).commit();//将页面的Fragment绑定到件上 getFragmentManager().beginTransaction().add(R.id.left, mLeftFragment).commit();方法使用方法名说明setSlidersDrawables(int verticalDrawable, int horizontalDrawable)Set de drawables for the slider in horizontal and vertical like this example: setSlidersDrawables(R.drawable.slider_vertical, R.drawable.slider_horizontal)设置slider(左、右页面中间部分的)的图标,分为垂直的和水平的图标setSliderSize(int size)设置slider的宽度switchSliderVisitility();以动画方式切换setBaseOrientation(int orientation)Set the orientation of the panels with the values LinearLayout.VERTICAL or LinearLayout.HORIZONTAL, default is LinearLayout.HORIZONTAL.设置排列方式,水平的还是垂直的slideFragmentsToRight()Slide the fragments to the right with an animation.隐藏掉右页面或下页面,相当于点击俩次右箭头slideFragmentsToLeft()Slide the fragments to the left with an animation隐藏掉左页面或上页面,相当于点击俩次左箭头.showTwoFragments()Show two panels in the screen.让俩个页面都显示,一般是调用了hideRight()、hideLeft后让俩个页面同时显示hideRight()Hide the right panel and show the left panel in full screen.隐藏右页面hideLeft()Hide the left panel and show the right panel in full screen.隐藏左页面

64,687

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧