Home > Net > How to put the dataGridView name passed as a parameter to another function?
How to put the dataGridView name passed as a parameter to another function?
Time:10-11
I taught myself C # entry, only a little bit of C foundation, now want to piece together a program that directly dataGridView function is derived by using https://www.cnblogs.com/hfzsjz/archive/2013/05/07/3064231.html here the complete code, because I'm WinForm form needs to have multiple interfaces in dataGridView export function, want to change the code contained in the links above to functions, use place pass dataGridView name as a parameter to it, under the guidance of how to do it, please. Thank you,
//write title for (int i=0; i dataGridView1 . ColumnCount; I++) { If (I & gt; 0) { STR +="\ t"; } STR += dataGridView1 . The Columns [I] the HeaderText; }
Red font is to replace the function of parameters,
CodePudding user response:
This let me how to answer: why do you want to pass the string? Direct transmission control? Besides the normal logic should be inherited their control and then give their control method of defining a common mygrid directly and use it every time. The export