且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在datagridview单元格上执行求和操作,并使用vb.net将结果存储在下一个单元格中

更新时间:2023-12-03 11:57:34

如果您使用网络应用程序,那么请输入代码...



首先取两个文本框为你数据...



一键添加



一个文本框结果...

你必须写下面的代码...



int frstnum;

int secnum;

int total;

frstnum = convert.parse(textbox1.text);

secnum = convert.parse (textbozx2.text);

total = frstnum + secnum;

textbox3.text = total.tostring();

meessagebox.show( 结果是+ textbox3.text +);
if ur using web application then go wth the code...

frst take two text boxes for ur data...

one button for for adding

one text box for result...

in button u have to write the below code...

int frstnum;
int secnum;
int total;
frstnum=convert.parse(textbox1.text);
secnum=convert.parse(textbozx2.text);
total=frstnum+secnum;
textbox3.text=total.tostring();
meessagebox.show("the result is + textbox3.text +");