Bug 微软的大Bug

zhiang75 2004-06-18 04:52:47
大家用过c#的滚动条控检吗?
我运行这个程序发现
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace WindowsApplication5
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.VScrollBar vScrollBar1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.HScrollBar hScrollBar1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;

public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();

//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}

/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.vScrollBar1 = new System.Windows.Forms.VScrollBar();
this.button1 = new System.Windows.Forms.Button();
this.hScrollBar1 = new System.Windows.Forms.HScrollBar();
this.SuspendLayout();
//
// vScrollBar1
//
this.vScrollBar1.Dock = System.Windows.Forms.DockStyle.Right;
this.vScrollBar1.Location = new System.Drawing.Point(276, 0);
this.vScrollBar1.Maximum = 100;
this.vScrollBar1.Name = "vScrollBar1";
this.vScrollBar1.Size = new System.Drawing.Size(16, 273);
this.vScrollBar1.TabIndex = 0;
this.vScrollBar1.ValueChanged += new System.EventHandler(this.vScrollBar1_ValueChanged);
this.vScrollBar1.Scroll += new System.Windows.Forms.ScrollEventHandler(this.vScrollBar1_Scroll);
//
// button1
//
this.button1.Location = new System.Drawing.Point(168, 80);
this.button1.Name = "button1";
this.button1.TabIndex = 1;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// hScrollBar1
//
this.hScrollBar1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.hScrollBar1.Location = new System.Drawing.Point(0, 257);
this.hScrollBar1.Name = "hScrollBar1";
this.hScrollBar1.Size = new System.Drawing.Size(276, 16);
this.hScrollBar1.TabIndex = 2;
this.hScrollBar1.Scroll += new System.Windows.Forms.ScrollEventHandler(this.hScrollBar1_Scroll);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.Add(this.hScrollBar1);
this.Controls.Add(this.button1);
this.Controls.Add(this.vScrollBar1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);

}
#endregion

/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}

private void vScrollBar1_ValueChanged(object sender, System.EventArgs e)
{
//this.Text=vScrollBar1.Value.ToString();
}

private void vScrollBar1_Scroll(object sender, System.Windows.Forms.ScrollEventArgs e)
{
this.Text=vScrollBar1.Value.ToString();

}

private void button1_Click(object sender, System.EventArgs e)
{

}

private void hScrollBar1_Scroll(object sender, System.Windows.Forms.ScrollEventArgs e)
{
this.Text=hScrollBar1.Value.ToString();
}
}
}

用鼠标调整滚动条,怎样调都无法达到最大数100 只能达到91
不知道是为什么,大家帮看看.

我用的是VS2003,win2kp
版本信息是:
7.1.3091

这个BUG可费我3天的时间啊.......
...全文
165 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
EventLog 2004-07-05
  • 打赏
  • 举报
回复
用google搜 avi素材。
CsdnRob 2004-07-01
  • 打赏
  • 举报
回复
用google搜 avi素材。
CsdnRob 2004-07-01
  • 打赏
  • 举报
回复
用google搜 avi素材。
  • 打赏
  • 举报
回复
算半个BUG吧,不管怎么说是有点不方便
zhiang75 2004-06-18
  • 打赏
  • 举报
回复
^_^,以前用delphi可没那么回事,vb6也没有,此控件的说明也没有特别指出。算了,不是就不是,以后记着吧
9sun888 2004-06-18
  • 打赏
  • 举报
回复
滚动条的最大值不能通过运行时的用户交互而达到。这个可以达到的最大值等于 Maximum 属性值减去 LargeChange 属性值加一。该最大值只能以编程方式达到。
whizstorm 2004-06-18
  • 打赏
  • 举报
回复
楼上两为强!!!
dldl 2004-06-18
  • 打赏
  • 举报
回复
同意楼上的看法
haiwangstar 2004-06-18
  • 打赏
  • 举报
回复
这不是BUG!!


你要搞清楚:ScrollBar的Value范围是从Minimum 到 (Maximum + 1 - LargeChange) 而LargeChange 的默认值正好是10.
flyingFisher 2004-06-18
  • 打赏
  • 举报
回复
帮你UP吧。
zhiang75 2004-06-18
  • 打赏
  • 举报
回复
自己UP

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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