📄 1445.html
字号:
<html> <head> <title>视窗内的ScrollBar出不来?</title> </head> <BODY BACKGROUND="" BGCOLOR="white" TEXT="black" LINK="blue" VLINK="#808080" ALINK="red"> <center> <h1>视窗内的ScrollBar出不来?</h1> </center><HR><p>Posted by <a href="mailto:r5228009@ms.cc.ntu.edu.tw">小夙</a> on December 03, 1997 at 02:25:27:<p>请问小吴:<p> 我想作一个有ScrollBar的图形视窗,因此我就参照使用手册(基础篇)上的方式,先建立两个重叠的PictureBox,一个为子视窗(PBScrollView),一个为父视窗(PBExactView),其上有VScroll(VScroll1)和HScroll(HScroll1)两个控制项,Run了之后,视窗内的ScrollBar一直出不来,以下是相关的程式码,请小吴不各赐教..<p>注:frmD是我的表单名称<br> <p>Private Sub Form_Load()<br> <br> <br> frmD.ScaleMode = vbPixels<br> PBScrollView.ScaleMode = vbPixels<br> PBExactView.AutoSize = True<br> <br> PBScrollView.BorderStyle = 0<br> PBExactView.BorderStyle = 0<br> <br> PBExactView.Picture = LoadPicture("c:\windows\setup.bmp")<br> <br> PBScrollView.Move 0, 0, ScaleWidth - VScroll1.Width, _<br> ScaleHeight - HScroll1.Height<br> PBExactView.Move 0, 0<br> <br> <br> HScroll1.Top = PBScrollView.Height<br> HScroll1.Left = 0<br> HScroll1.Width = PBScrollView.Width<p> VScroll1.Top = 0<br> VScroll1.Left = PBScrollView.Width<br> VScroll1.Width = PBScrollView.Height<br> <br> HScroll1.Max = PBExactView.Width - PBScrollView.Width<br> VScroll1.Max = PBExactView.Height - PBScrollView.Height<br>****************************************************************** <br> VScroll1.Visible = (PBScrollView.Height < PBExactView.Height) <br> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br> HScroll1.Visible = (PBScrollView.Width < PBExactView.Width)<br> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br> 注:"VScroll1.Visible = 一直是"False"?不知何故?<br>****************************************************************** <br>End Sub<p>Private Sub Form_Resize()<br> <br> PBExactView.Height = frmD.Height<br> PBExactView.Width = frmD.Width<br> <br> PBScrollView.Move 0, 0, ScaleWidth - VScroll1.Width, _<br> ScaleHeight - HScroll1.Height<br> PBExactView.Move 0, 0<br> <br> HScroll1.Top = PBScrollView.Height<br> HScroll1.Left = 0<br> HScroll1.Width = PBScrollView.Width<br> <br> VScroll1.Top = 0<br> VScroll1.Left = PBScrollView.Width<br> VScroll1.Width = PBScrollView.Height<br> <br> HScroll1.Max = PBExactView.Width - PBScrollView.Width<br> VScroll1.Max = PBExactView.Height - PBScrollView.Height<br> <br> VScroll1.Visible = (PBScrollView.Height < PBExactView.Height)<p> HScroll1.Visible = (PBScrollView.Width < PBExactView.Width)<br> <br>End Sub<p><br>Private Sub HScroll1_Change()<br> PBScrollView.Left = -HScroll1.Value<br>End Sub<p>Private Sub VScroll1_Change()<br> PBScrollView.Top = -VScroll1.Value<br>End Sub<br><p><a name="followups">Follow Ups:</a><br><ul><!--insert: 1445--><!--top: 1448--><li><a href="1448.html"><b>继续加油</b></a> 小吴 <i>20:13:52 12/03/97</i>(<!--responses: 1448-->1)<ul><!--insert: 1448--><!--top: 1450--><li><a href="1450.html"><b>谢谢小吴</b></a> 小夙 <i>00:12:06 12/04/97</i>(<!--responses: 1450-->0)<ul><!--insert: 1450--></ul><!--end: 1450--></ul><!--end: 1448--></ul><!--end: 1445--><br><HR><p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -