类型:转载 责任编辑:asp 日期:2007/03/01
我用的cformview类 在对话框中用了几个滑条(csliderctrl)
我在 oninitialupdate()中设置他的范围( setrange(0,250))
但是运行后 还是默认的0到100
请高手给出正确的方法!!!
推荐阅读
我用以下的代码实现了使用setrange,你可以试一下,如果成功的话,给我加分哟。
bool chelpapp::initinstance()
{
afxenablecontrolcontainer();
#ifdef _afxdll
enable3dcontrols();
#else
enable3dcontrolsstatic();
#endif
setregistrykey(_t("local appwizard-generated applications"));
loadstdprofilesettings();
cmultidoctemplate* pdoctemplate;
pdoctemplate = new cmultidoctemplate(
idr_helptype,
runtime_class(chelpdoc),
runtime_class(cchildframe),
runtime_class(chelpformview));
adddoctemplate(pdoctemplate);
cmainframe* pmainframe = new cmainframe;
if (!pmainframe->loadframe(idr_mainframe))
return false;
m_pmainwnd = pmainframe;
ccommandlineinfo cmdinfo;
parsecommandline(cmdinfo);
if (!processshellcommand(cmdinfo))
return false;
pmainframe->showwindow(m_ncmdshow);
pmainframe->updatewindow();
return true;
}
void chelpformview::oninitialupdate()
{
cformview::oninitialupdate();
m_pslider=new csliderctrl;
m_pslider->create (ws_border | ws_child | ws_visible | tbs_autoticks | tbs_both,crect(0,0,100,100),this,55);
m_pslider->setrange (0,5);
}