日期:2014-05-19  浏览次数:20943 次

textbox绑定数据并可以通过按钮显示下一条?谢谢
textbox绑定数据并可以通过按钮显示下一条?谢谢
就是通过4个按钮   显示下一条,上一条,最后一条,和第一条!     怎么写啊!   谢谢各位了!

------解决方案--------------------
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace BindingTest2
{
public class Class1 : Form
{
#region Windows 窗体设计器生成的代码

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(432, 12);
this.button1.Name = "button1 ";
this.button1.Size = new System.Drawing.Size(79, 25);
this.button1.TabIndex = 0;
this.button1.Text = "填充数据 ";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(143, 12);
this.textBox1.Name = "textBox1 ";
this.textBox1.Size = new System.Drawing.Size(100, 21);
this.textBox1.TabIndex = 1;
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(269, 12);
this.textBox2.Name = "textBox2 ";
this.textBox2.Size = new System.Drawing.Size(100, 21);
this.textBox2.TabIndex = 2;
//
// button2
//
this.button2.Location = new System.Drawing.Point(182, 70);
this.button2.Name = "button2 ";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 3;
this.button2.Text = "上一条 ";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(263, 70);
this.button3.Name = "button3 ";
this.button3.Size = new System.Drawing.Size(75, 23);
this.button3.TabIndex = 4;
this.button3.Text = "下一条 ";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// Class1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(573, 121);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBo