Thread: c# return statement
hi all.
have c# asp.net site run methode
the tbu.tablecreationone(); has return statement sayingcode:protectedvoid page_load(object sender, eventargs e) { tbu.tablecreationone(); //this replace tablecreationone //tablecreationone(); tablecreationaction(); }
tb1 = table1.code:return tb1;
when return tb1 how "grab" , add form. in "old" way this
but here don't return class.code:form1.controls.add(tb1);
little code dump. "old" way of doing it.
hope can me. if need more info, please don't hesitate ask.code://public void tablecreationone() //{ // //more information on forms visit: http://forums.devx.com/archive/index.php/t-99981.html // //create table // table tb1 = new table(); // //set table width // tb1.borderwidth = 1; // //create tabel cells // tablerow row = new tablerow(); // tablecell cell1 = new tablecell(); // tablecell cell2 = new tablecell(); // tablecell cell3 = new tablecell(); // tablecell cell4 = new tablecell(); // tablecell cell5 = new tablecell(); // tablecell cell6 = new tablecell(); // tablecell cell7 = new tablecell(); // tablecell cell8 = new tablecell(); // tablecell cell9 = new tablecell(); // tablecell cell10 = new tablecell(); // //add cells row // row.cells.add(cell1); // row.cells.add(cell2); // row.cells.add(cell3); // row.cells.add(cell4); // row.cells.add(cell5); // row.cells.add(cell6); // row.cells.add(cell7); // row.cells.add(cell8); // row.cells.add(cell9); // row.cells.add(cell10); // tb1.rows.add(row); // //set cells border width // cell1.borderwidth = 1; // cell1.style["text-align"] = "center"; // //cell1.width = 70; // cell1.width = unit.pixel(70); // cell2.borderwidth = 1; // cell2.style["text-align"] = "center"; // //cell2.width = 250; // cell2.width = unit.pixel(250); // cell3.borderwidth = 1; // cell3.style["text-align"] = "center"; // //cell3.width = 100; // cell3.width = unit.pixel(100); // cell4.borderwidth = 1; // cell4.style["text-align"] = "center"; // //cell4.width = 70; // cell4.width = unit.pixel(80); // cell5.borderwidth = 1; // cell5.style["text-align"] = "center"; // //cell5.width = 90; // cell5.width = unit.pixel(90); // cell6.borderwidth = 1; // cell6.style["text-align"] = "center"; // //cell6.width = 70; // cell6.width = unit.pixel(80); // cell7.borderwidth = 1; // cell7.style["text-align"] = "center"; // //cell7.width = 100; // cell7.width = unit.pixel(100); // cell8.borderwidth = 1; // cell8.style["text-align"] = "center"; // //cell8.width = 200; // cell8.width = unit.pixel(200); // cell9.borderwidth = 1; // cell9.style["text-align"] = "center"; // //cell9.width = 100; // cell9.width = unit.pixel(100); // cell10.borderwidth = 1; // cell10.style["text-align"] = "center"; // //cell10.width = 100; // cell10.width = unit.pixel(100); // //add static content cells // cell1.text = getandset._removed; // cell2.text = getandset._removed; // cell3.text = getandset._removed; // cell4.text = getandset._removed; // cell5.text = getandset._removed; // cell6.text = getandset._removed; // cell7.text = getandset._removed; // cell8.text = getandset._removed; // cell9.text = getandset._removed; // cell10.text = getandset._removed; // //add table page // form1.controls.add(tb1); //} the "new" way has replaced form1.controls.add(tb1) witn return tb1;
add. i'm no c# expert @ all, im learning. apologise obivious mistakes.
on advance.
kind regards.
i'm sorry, i'm having difficult time in comprehending attempting achieve.
if still using form1, do,
form1.controls.add(tbu.tablecreationone());
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [SOLVED] c# return statement
Ubuntu
Comments
Post a Comment