Click here to Skip to main content
15,918,808 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Googolplex Program Pin
David Crow1-Nov-05 5:38
David Crow1-Nov-05 5:38 
GeneralRe: Googolplex Program Pin
ericelysia1-Nov-05 5:56
ericelysia1-Nov-05 5:56 
GeneralRe: Googolplex Program Pin
toxcct1-Nov-05 6:23
toxcct1-Nov-05 6:23 
GeneralRe: Googolplex Program Pin
David Crow1-Nov-05 7:14
David Crow1-Nov-05 7:14 
AnswerRe: Googolplex Program Pin
toxcct1-Nov-05 6:13
toxcct1-Nov-05 6:13 
GeneralRe: Googolplex Program Pin
ericelysia1-Nov-05 6:22
ericelysia1-Nov-05 6:22 
GeneralRe: Googolplex Program Pin
toxcct1-Nov-05 6:29
toxcct1-Nov-05 6:29 
GeneralRe: Googolplex Program Pin
ericelysia1-Nov-05 6:39
ericelysia1-Nov-05 6:39 
Questionget bit rate supported by a portable device Pin
decang1-Nov-05 5:00
decang1-Nov-05 5:00 
QuestionLooking for API method to find component version ... Pin
Yanshof1-Nov-05 4:00
Yanshof1-Nov-05 4:00 
AnswerRe: Looking for API method to find component version ... Pin
Chris Losinger1-Nov-05 4:44
professionalChris Losinger1-Nov-05 4:44 
Questionif (23 == x) or if (x == 23) Pin
Anorexic Tribble1-Nov-05 2:58
Anorexic Tribble1-Nov-05 2:58 
AnswerRe: if (23 == x) or if (x == 23) Pin
Justin Hallet1-Nov-05 3:11
Justin Hallet1-Nov-05 3:11 
AnswerRe: if (23 == x) or if (x == 23) Pin
grigsoft1-Nov-05 3:16
grigsoft1-Nov-05 3:16 
QuestionHow to convert textfile into variables and arrays? Pin
jedenddhsakjldf1-Nov-05 2:00
jedenddhsakjldf1-Nov-05 2:00 
QuestionRe: How to convert textfile into variables and arrays? Pin
David Crow1-Nov-05 2:25
David Crow1-Nov-05 2:25 
AnswerRe: How to convert textfile into variables and arrays? Pin
kakan1-Nov-05 19:22
professionalkakan1-Nov-05 19:22 
QuestionStuck again... Pin
jedenddhsakjldf7-Nov-05 13:29
jedenddhsakjldf7-Nov-05 13:29 
AnswerRe: Stuck again... Pin
kakan7-Nov-05 21:02
professionalkakan7-Nov-05 21:02 
GeneralRe: Stuck again... Pin
jedenddhsakjldf8-Nov-05 9:21
jedenddhsakjldf8-Nov-05 9:21 
Tyvärr bor jag i södra Finland, närmare bestämt i esbo. Jag hoppas att du kan hjälpa mig i alla fall ;D

Nope, Scrollbars are still deadFrown | :( I can move them but as soon as I release my finger "scroller" returns to the zero position. Just like before.

here is some code:
#if !defined(AFX_SCROLLHOR1_H__320F4D47_5576_4A56_8154_F0672773B771__INCLUDED_)<br />
#define AFX_SCROLLHOR1_H__320F4D47_5576_4A56_8154_F0672773B771__INCLUDED_<br />
<br />
#if _MSC_VER > 1000<br />
#pragma once<br />
#endif // _MSC_VER > 1000<br />
// ScrollHor1.h : header file<br />
//<br />
<br />
/////////////////////////////////////////////////////////////////////////////<br />
// CScrollHor dialog<br />
<br />
class CScrollHor : public CDialog<br />
{<br />
// Construction<br />
public:<br />
	void SetBar();<br />
	CScrollHor(CWnd* pParent = NULL);   // standard constructor<br />
<br />
// Dialog Data<br />
	//{{AFX_DATA(CScrollHor)<br />
	enum { IDD = IDD_SCROLL_HOR };<br />
	CScrollBar	m_horisontal2;<br />
	int		m_horisontal;<br />
	//}}AFX_DATA<br />
<br />
<br />
// Overrides<br />
	// ClassWizard generated virtual function overrides<br />
	//{{AFX_VIRTUAL(CScrollHor)<br />
	protected:<br />
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support<br />
	//}}AFX_VIRTUAL<br />
<br />
// Implementation<br />
protected:<br />
<br />
	// Generated message map functions<br />
	//{{AFX_MSG(CScrollHor)<br />
	afx_msg void OnPaint();<br />
	virtual BOOL OnInitDialog();<br />
	//}}AFX_MSG<br />
	DECLARE_MESSAGE_MAP()<br />
};<br />
<br />
//{{AFX_INSERT_LOCATION}}<br />
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.<br />
<br />
#endif // !defined(AFX_SCROLLHOR1_H__320F4D47_5576_4A56_8154_F0672773B771__INCLUDED_)


And more...
// ScrollHor1.cpp : implementation file<br />
//<br />
<br />
#include "stdafx.h"<br />
#include "Busybee.h"<br />
#include "ScrollHor1.h"<br />
<br />
#ifdef _DEBUG<br />
#define new DEBUG_NEW<br />
#undef THIS_FILE<br />
static char THIS_FILE[] = __FILE__;<br />
#endif<br />
<br />
/////////////////////////////////////////////////////////////////////////////<br />
// CScrollHor dialog<br />
<br />
<br />
CScrollHor::CScrollHor(CWnd* pParent /*=NULL*/)<br />
	: CDialog(CScrollHor::IDD, pParent)<br />
{<br />
	//{{AFX_DATA_INIT(CScrollHor)<br />
	m_horisontal = 0;<br />
	//}}AFX_DATA_INIT<br />
SetBar();<br />
<br />
}<br />
<br />
<br />
void CScrollHor::DoDataExchange(CDataExchange* pDX)<br />
{<br />
	CDialog::DoDataExchange(pDX);<br />
	//{{AFX_DATA_MAP(CScrollHor)<br />
	DDX_Control(pDX, IDC_SCROLLBARHOR, m_horisontal2);<br />
	DDX_Scroll(pDX, IDC_SCROLLBARHOR, m_horisontal);<br />
	//}}AFX_DATA_MAP<br />
}<br />
<br />
<br />
BEGIN_MESSAGE_MAP(CScrollHor, CDialog)<br />
	//{{AFX_MSG_MAP(CScrollHor)<br />
	ON_WM_PAINT()<br />
	//}}AFX_MSG_MAP<br />
END_MESSAGE_MAP()<br />
<br />
/////////////////////////////////////////////////////////////////////////////<br />
// CScrollHor message handlers<br />
<br />
void CScrollHor::SetBar()<br />
{<br />
	m_horisontal2.SetScrollRange(0,100,false);<br />
	m_horisontal2.SetScrollPos(50,true);<br />
	m_horisontal=50;<br />
<br />
}<br />
<br />
void CScrollHor::OnPaint() <br />
{<br />
<br />
	SetBar();      //an attempt to het the damn thing to move<br />
                       //It would of course be more useful to be able to move<br />
                       //it with mouse:) <br />
	<br />
<br />
	CPaintDC dc(this); // device context for painting<br />
	<br />
	// TODO: Add your message handler code here<br />
	<br />
	// Do not call CDialog::OnPaint() for painting messages<br />
}<br />
<br />
<br />
BOOL CScrollHor::OnInitDialog() <br />
{<br />
	CDialog::OnInitDialog();<br />
	<br />
	// TODO: Add extra initialization here Just some testing...<br />
	m_horisontal2.SetScrollRange(0,100,false);<br />
	m_horisontal2.SetScrollPos(50,true);<br />
	m_horisontal=50;<br />
<br />
	return TRUE;  // return TRUE unless you set the focus to a control<br />
	              // EXCEPTION: OCX Property Pages should return FALSE<br />
}<br />


Some additional questions:
How to set the width of that scrollbar?
Is there a way to add windows message OnScroll or something - for these scrollbars?
GeneralRe: Stuck again... Pin
kakan8-Nov-05 20:47
professionalkakan8-Nov-05 20:47 
GeneralRe: Stuck again... Pin
kakan8-Nov-05 21:38
professionalkakan8-Nov-05 21:38 
Question[Message Deleted] Pin
BeautyLord31-Oct-05 23:38
BeautyLord31-Oct-05 23:38 
AnswerRe: how about your hands in here? Pin
toxcct1-Nov-05 0:07
toxcct1-Nov-05 0:07 
AnswerRe: how about your hands in here? Pin
#realJSOP1-Nov-05 1:56
professional#realJSOP1-Nov-05 1:56 

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.