我有以下代码,它工作正常。每当我显示信息时,我会得到一个完整的窗口,但它已被显示,我必须使窗口更大。我想插入一个vScrollBar但我不知道如何使它工作。我能够将它插入到我的表单中,但每当我执行windows时,vScrollBar都不会执行任何操作
在这里,您有我的代码,谢谢大家提前
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace TestData
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void button1_Click(object sender, EventArgs e)
{
com.Dashboard proxy = new com.Dashboard();
com.ProjectMetaData[] nc = proxy.GetAllProject();
StringBuilder sb = new StringBuilder();
foreach (com.ProjectMetaData value in nc)
{
/*sb.AppendLine(string.Join("\t",value.ProjectTitle
+ string.Join("\t",value.ProjectID)
+ string.Join("\t",value.PublishStatus)));*/
sb.AppendLine("\r");
sb.AppendLine(value.ProjectTitle + " " + value.ProjectID + " " + value.PublishStatus);
}
//StringBuilder.StringBuilder();
label1.Text = sb.ToString();
}
public void vScrollBar1_Scroll(object sender, ScrollEventArgs e)
{
}
}
}
答案 0 :(得分:1)
这很简单。
AutoScroll
属性设置为true
。屏幕截图。
滚动条位于底部时的屏幕截图。