Click here to Skip to main content
15,919,613 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Unable to move slider position using mouse [modified] Pin
John50226-Jan-09 4:30
John50226-Jan-09 4:30 
GeneralRe: Unable to move slider position using mouse Pin
Mark Salsbery26-Jan-09 5:50
Mark Salsbery26-Jan-09 5:50 
GeneralRe: Unable to move slider position using mouse [modified] Pin
John50226-Jan-09 6:05
John50226-Jan-09 6:05 
GeneralRe: Unable to move slider position using mouse Pin
Mark Salsbery26-Jan-09 6:23
Mark Salsbery26-Jan-09 6:23 
GeneralRe: Unable to move slider position using mouse [modified] Pin
John50226-Jan-09 6:43
John50226-Jan-09 6:43 
GeneralRe: Unable to move slider position using mouse Pin
Mark Salsbery26-Jan-09 6:46
Mark Salsbery26-Jan-09 6:46 
GeneralRe: Unable to move slider position using mouse [modified] Pin
John50226-Jan-09 7:17
John50226-Jan-09 7:17 
GeneralRe: Unable to move slider position using mouse Pin
Mark Salsbery26-Jan-09 7:26
Mark Salsbery26-Jan-09 7:26 
You should be creating the control the same way you did before,
just using your new class.

All you should have to change is the class. There's no new Init function necessary.

Here's the basic shell of a CSliderCtrl derived class:
// MySliderCtrl.h

#pragma once

class CMySliderCtrl : public CSliderCtrl
{
	DECLARE_DYNAMIC(CMySliderCtrl)

public:
	CMySliderCtrl();
	virtual ~CMySliderCtrl();

protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
};

// MySliderCtrl.cpp

#include "stdafx.h"
#include "MyApp.h"
#include "MySliderCtrl.h"


IMPLEMENT_DYNAMIC(CMySliderCtrl, CSliderCtrl)

CMySliderCtrl::CMySliderCtrl()
{
}

CMySliderCtrl::~CMySliderCtrl()
{
}


BEGIN_MESSAGE_MAP(CMySliderCtrl, CSliderCtrl)
	ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()


// CMySliderCtrl message handlers

void CMySliderCtrl::OnLButtonDown(UINT nFlags, CPoint point)
{
	CSliderCtrl::OnLButtonDown(nFlags, point);
}

Create the control the same way you did before:
m_slider_bar1 = new CMySliderCtrl();
m_slider_bar1->Create(...


Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Unable to move slider position using mouse [modified] Pin
John50226-Jan-09 22:30
John50226-Jan-09 22:30 
GeneralRe: Unable to move slider position using mouse Pin
Mark Salsbery27-Jan-09 5:58
Mark Salsbery27-Jan-09 5:58 
QuestionTooltip problem Pin
madmax000124-Jan-09 8:30
madmax000124-Jan-09 8:30 
AnswerRe: Tooltip problem Pin
Hans Dietrich25-Jan-09 6:53
mentorHans Dietrich25-Jan-09 6:53 
GeneralRe: Tooltip problem Pin
madmax000125-Jan-09 9:07
madmax000125-Jan-09 9:07 
AnswerRe: Tooltip problem Pin
KarstenK26-Jan-09 3:20
mveKarstenK26-Jan-09 3:20 
GeneralRe: Tooltip problem Pin
madmax000126-Jan-09 6:11
madmax000126-Jan-09 6:11 
QuestionNeed help regarding the slider Pin
John50224-Jan-09 8:22
John50224-Jan-09 8:22 
QuestionRe: Need help regarding the slider Pin
David Crow24-Jan-09 14:09
David Crow24-Jan-09 14:09 
AnswerRe: Need help regarding the slider Pin
John50225-Jan-09 0:39
John50225-Jan-09 0:39 
GeneralRe: Need help regarding the slider Pin
Mark Salsbery25-Jan-09 7:38
Mark Salsbery25-Jan-09 7:38 
QuestionNeed some help on how to create a Line and how to move that line using mouse options Pin
John50224-Jan-09 4:47
John50224-Jan-09 4:47 
AnswerRe: Need some help on how to create a Line and how to move that line using mouse options Pin
Hamid_RT24-Jan-09 5:15
Hamid_RT24-Jan-09 5:15 
GeneralRe: Need some help on how to create a Line and how to move that line using mouse options Pin
John50224-Jan-09 12:30
John50224-Jan-09 12:30 
AnswerRe: Need some help on how to create a Line and how to move that line using mouse options Pin
PJ Arends24-Jan-09 5:44
professionalPJ Arends24-Jan-09 5:44 
GeneralRe: Need some help on how to create a Line and how to move that line using mouse options Pin
John50224-Jan-09 12:31
John50224-Jan-09 12:31 
AnswerRe: Need some help on how to create a Line and how to move that line using mouse options Pin
bob1697224-Jan-09 7:36
bob1697224-Jan-09 7:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.