如何使用c#中的字符串数组的每个值从文本框添加文本 [英] how to add text from textbox with each value of string array in c#

查看:458
本文介绍了如何使用c#中的字符串数组的每个值从文本框添加文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。我正在开发一个excel插件。我有一个寡妇形式,其中包含文本框,列表框,datagridview和一个按钮。在列表框中,我列出了所有列标题,如A,B,C等。来自excel。当我从列表框中选择A时,它将从excel中选择A的所有usedrange值。现在我希望当我从列表框中选择然后它将选择该列值并转换为字符串数组或对象(肯定我不应该是什么)。当我在文本框中写入并在datagridview行中显示时,应该使用我的文本添加此字符串数组。感谢您的任何帮助。

这个例子就是我想要做的:



string [] str = {ram,shyam, geeta}



textbox text + string array / object = datagridview rows



hello + ram = hello ram

+ shyam =你好shyam

+ geeta =你好geeta



请帮帮我。

解决方案

hello everyone. i am developing a excel plugin. i have a widow form which contains textbox, listbox ,datagridview and a button. in listbox i make a list of all column headers like A,B,C,etc. from excel. when i select 'A' from listbox ,it will select all the usedrange values of A from excel. now i want that when i select from listbox then it will select that column values and convert into string array or object (positively i do not what should it). this string array should be add with my text as i write in textbox and show in datagridview rows. thanks for any help in advance.
This example is what i want to do:

string[] str={ram,shyam,geeta}

textbox text + string array/object = datagridview rows

hello + ram = hello ram
+ shyam = hello shyam
+ geeta = hello geeta

please help me.

解决方案

这篇关于如何使用c#中的字符串数组的每个值从文本框添加文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆