YOU CAN CODE!

 

With The Case Of UCanCode.net  Release The Power OF  Visual C++ !   HomeProducts | PurchaseSupport | Downloads  
Download Evaluation
Pricing & Purchase?
E-XD++Visual C++/ MFC Products
Overview
Features Tour 
Electronic Form Solution
Visualization & HMI Solution
Power system HMI Solution
CAD Drawing and Printing Solution

Bar code labeling Solution
Workflow Solution

Coal industry HMI Solution
Instrumentation Gauge Solution

Report Printing Solution
Graphical modeling Solution
GIS mapping solution

Visio graphics solution
Industrial control SCADA &HMI Solution
BPM business process Solution

Industrial monitoring Solution
Flowchart and diagramming Solution
Organization Diagram Solution

Graphic editor Source Code
UML drawing editor Source Code
Map Diagramming Solution

Architectural Graphic Drawing Solution
Request Evaluation
Purchase
ActiveX COM Products
Overview
Download
Purchase
Technical Support
  General Q & A
Discussion Board
Contact Us

Links

Get Ready to Unleash the Power of UCanCode .NET

 


UCanCode Software focuses on general application software development. We provide complete solution for developers. No matter you want to develop a simple database workflow application, or an large flow/diagram based system, our product will provide a complete solution for you. Our product had been used by hundreds of top companies around the world!

"100% source code provided! Free you from not daring to use components because of unable to master the key technology of components!"


VC++ MFC Example: A Slider Control, CSliderCtrl

 
Pedro Pombeiro  

What does it do?

This derivation of CSliderCtrl allows the user to use the mouse or the keyboard to select a range in the slider control. The program can then use CSliderCtrl::GetSelection() to retrieve the range selected by the user. This is the way I thought that CSliderCtrl worked in the first place, only to discover that the selection was just a static representation of the values set by CSliderCtrl::SetSelection(). This class corrects this shortcoming of the slider control.

How to use it?

This code was originally compiled and tested with Visual C++ 4.2 and WinNT 4.0 SP4. It should not present any problem when using a more recent version of the compiler.

Be aware that you need to turn on the TBS_ENABLESELRANGE style for the control.

The usage is very simple you just have to include the files in your project, replace the ocurrences of CSliderCtrl in your code for CSelectionSliderCtrl and include SelectionSliderCtrl.h. For example


// MyDialog.h  header file
//


/////////////////////////////////////////////////////////////////////////////
// CMyDialog dialog


#include "SelectionSliderCtrl.h"

class CMyDialog  public CDialog
{
...


// Dialog Data
	//{{AFX_DATA(CMyDialog)
	enum { IDD = IDD_MY_DIALOG };
	//}}AFX_DATA
	CSelectionSliderCtrl	m_sliderTest;
...
};

Download source - 3 Kb

 

Copyright ?1998-2022 UCanCode.Net Software , all rights reserved.
Other product and company names herein may be the trademarks of their respective owners.

Please direct your questions or comments to webmaster@ucancode.net