S60 设置ListBox控件滚动条位置

applealin 2008-02-21 12:07:34
我创建 ListBox,并创建了ScrollBar,设置 ListBox 的位置后,但是ScrollBar 的位置确不能跟ListBox的位置变动,是否哪有步骤遗留呢?

代码段如下:

--------------------------------------------------------------------------
void CListBoxTestAppView::ConstructL( const TRect& aRect )
{
CreateWindowL();

CreateListBox();

SetRect( aRect );

ActivateL();
}

void CListBoxTestAppView::SizeChanged()
{
iTestListBox->SetExtent(TPoint(0, 80), TSize(240, 120));
}

void CListBoxTestAppView::CreateListL()
{
// First phase construction
iTestListBox= new (ELeave)CAknSingleStyleListBox;
iTestListBox->SetContainerWindowL(*this);

// Second Phase Construction
TResourceReader reader;
iEikonEnv->CreateResourceReaderLC(reader, R_TEST_LISTBOX);
iTestListBox->ConstructFromResourceL(reader);
CleanupStack::PopAndDestroy(); // reader

// Setup the ScrollBar
SetupScrollBarsL();
}

void CListBoxTestAppView::SetupScrollBarsL()
{
iTestListBox->CreateScrollBarFrameL(ETrue);
iTestListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
}
--------------------------------------------------------------------------
...全文
198 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
梦竹 2011-09-22
  • 打赏
  • 举报
回复
设置anchor属性
UltraBejing 2008-05-01
  • 打赏
  • 举报
回复
有问题请先GOOGLE,BAIDU

3,119

社区成员

发帖
与我相关
我的任务
社区描述
塞班系统(Symbian系统)是塞班公司为手机而设计的操作系统,它的前身是英国宝意昂公司的 EP ( Electronic Piece of cheese)操作系统。
社区管理员
  • Symbian社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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