请问如何控制memo的左右滚动?(75分)

  • 主题发起人 主题发起人 Israel
  • 开始时间 开始时间
I

Israel

Unregistered / Unconfirmed
GUEST, unregistred user!
这段程序可以让memo上下滚动,<br>procedure TForm1.Button2Click(Sender: TObject);<br>Var<br>&nbsp; ScrollMessage:TWMVScroll;<br>begin<br>&nbsp; ScrollMessage.Msg:=WM_VScroll;<br>&nbsp; ScrollMessage.ScrollCode:=SB_LINEDOWN;<br>&nbsp; ScrollMessage.Pos:=200;<br>&nbsp; memo1.Dispatch(ScrollMessage);<br>end;<br><br>但类似的这段程序却不能控制memo左右滚动,怎么回事?<br>procedure TForm1.Button1Click(Sender: TObject);<br>Var<br>&nbsp; ScrollMessage:TWMHScroll;<br>begin<br>&nbsp; ScrollMessage.Msg:=WM_HScroll;<br>&nbsp; ScrollMessage.ScrollCode:=SB_LINERIGHT;<br>&nbsp; ScrollMessage.Pos:=200;<br>&nbsp; memo1.Dispatch(ScrollMessage);<br>end;<br>
 
Memo1.ScrollBars := ssBoth;<br>我试过了, 你说的可以啊, 但是你输入的文本的长度必须大于Memo的宽度!<br>这样才可以!<br>procedure TForm1.Button1Click(Sender: TObject);<br>Var<br>&nbsp; ScrollMessage:TWMHScroll;<br>begin<br>&nbsp; ScrollMessage.Msg:=WM_HScroll;<br>&nbsp; ScrollMessage.ScrollCode:=SB_LINERIGHT;<br>&nbsp; ScrollMessage.Pos:=200;<br>&nbsp; memo1.Dispatch(ScrollMessage);<br>end;<br>
 
不知道你要干什么?能说详细点吗?[?][:)]
 
我要用命令控制memo内容的滚动。条件是memo不可以显示出滚动条,需要用其他控件的事件来驱动memo滚动。<br><br>to wcwcw:文本长度当然大于memo的宽度,但还是不行。
 
我要用命令控制memo的左右滚动。这里好象都说的是上下滚动,左右滚动怎么搞?再有,能否用TrackBar代替滚动条?
 
后退
顶部