大家好,我创建了一个listbox,有两个问题摆在面前:第一:如何改变ScrollBar的宽度?第二:我另外创建了四个button,“往前翻页”,“往后翻页”,“往下移动光标”,“向上移动”。比如,我的列表里边有20个选项,每页只显示5个,当我按下“往后翻页”按钮后,会显示下5个选项。当我按下“向下移动”按钮后,光标会移动到下一个选项。请问,这些如何实现呢?我在编程方便只能算是个入门级的,希望各问热心人不吝赐教,如何能提供code例示,那就再好不过了!多谢了!!
解决方案 »
- 如果自定义一个泛型集合
- 如何实现UDP广播发送/接收(发送后立即接收)?
- 如何实现将TREEVIEW控件绑定到DATAGRIDVIEW控件的单元格中?
- 关于存储过程不返回值
- 请教treeview控件展开的问题
- 初学c#向sql 添加数据 怎么都不成功 望高人指点
- 帮忙,帮忙,大哥大姐们帮帮忙
- 我在C#中编写一个WEB程序,但是按下的按钮没有反应?
- 这么简单的数据库操作都出错,谁来帮我
- web form 中在datagrid的edititem中cells的值该如何保存?在什么事件中触发保存呢?
- 如何将Datagridview 的数据 保存至 XML 文件,然后读取?
- UTF-8编码转换的奇怪现象
{
if (this.listBox1.SelectedIndex + 1 >= this.listBox1.Items.Count)
{
return;
}
this.listBox1.SelectedIndex += 1;
} private void button4_Click(object sender, EventArgs e)
{
if (this.listBox1.SelectedIndex - 1 < 0)
{
return;
}
this.listBox1.SelectedIndex -= 1;
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.Drawing.Printing;
using System.Runtime.InteropServices;
using System.Collections;
namespace Menu
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.AutoScale = true;
} private void label1_Click(object sender, EventArgs e)
{
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{ }
private void button2_Click(object sender, EventArgs e)
{
if (this.listBox1.SelectedIndex + 1 >= this.listBox1.Items.Count)
{
return;
}
}
}
}