2024年2月21日发(作者:)

红绿灯

namespace Redgreenyllow

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

d = true;

}

private void Form1_Load(object sender, EventArgs e)

{

ndex = 0;

}

private void timer1_Tick(object sender, EventArgs e)

{

if (ndex == 0)

{

+= 1;

+= 10;

if (==m)

{

= 0;

if ( == m)

{

=0;

ndex = 2;

}

}

}

if (ndex == 2)

{

+= 1;

+= 25;

if ( == m)

{

= 0;

if ( == m)

{

=0;

ndex = 1;

}

}

}

if (ndex == 1)

{

+= 1;

+= 10;

if ( == m)

{

= 0;

if ( == m)

{

=0;

ndex = 0;

}

}

}

}

private void button2_Click(object sender, EventArgs e)

{

d = false;

}

}

Listview

namespace view

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

private void button1_Click(object sender, EventArgs e)

{

for(int i=0;i<;i++)

{

if ([i].Text== )

{

("不能重复添加!");

= "";

break;

}

if(i==-1)

{

();

return;

}

}

}

private void button2_Click(object sender, EventArgs e)

{

for (int i = 0; i < ; i++)

{

if ([i].Text == )

{

("不能重复添加!");

= "";

return;

}

if (i == - 1)

{

();

return;

}

}

}

private void button3_Click(object sender, EventArgs e)

{

TreeNode rootNode = new TreeNode();

rootNode = edNode;

try

{

if ( == 0)

{

//移除当前节点

(rootNode);

}

else

{

( "该节点包含子节点!不能删除");

}

}

catch (Exception ex)

{

// 抛出异常

throw new Exception(e, ex);

}

}

private void button4_Click(object sender, EventArgs e)

{

();

}

}

}

Picture

namespace ViewPicture

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

private int nextShowNo = 0;

private void button1_Click(object sender, EventArgs e)

{

();

}

private void timer1_Tick(object sender, EventArgs e)

{

if (nextShowNo == )

{

nextShowNo = 0;

}

= [nextShowNo];

nextShowNo++;

}

private void button2_Click(object sender, EventArgs e)

{

d = false;

();

}

}

}