Reputation: 51
I have the follow code and it works fine. Whenever I display the information I get a full windows but its been displayed that I have to make bigger the windows.I would like to insert a vScrollBar but I dont know how to make it work. I was able to insert it into my form but whenever I execute the windows the vScrollBar doesnt do anything
Here you have my code, thanks you all in advance
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)
{
}
}
}
Upvotes: 1
Views: 140
Reputation: 3360
This is very simple.
AutoScroll
Property to true
.Screenshot while the scroll bar is at Top.
Screenshot while the scroll bar is at Bottom.
Upvotes: 1