使用button 做成fileupload的功能? 我只会使用fileupload上传文件,但现在要求使用button+textbox代替它,但是不知道怎么写? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 自定义控件,然后拖上去一个button和一个textbox组成一个组合控件即可 DevExpress控件库有现成的。很好用。(WinForm) button 事件里写: OpenFileDialog file = new OpenFileDialog(); if (file.ShowDialog(this) == DialogResult.Cancel) return; textbox.Text=file.FileName;LZ试试呗 private void Button_Click(object sender, RoutedEventArgs e) { OpenFileDialog dia = new OpenFileDialog(); dia.Multiselect = false; if (dia.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string fileName = dia.FileName; this.txtFileName.Text = fileName; } } 快捷键在WEBBROWSER里不起作用 Winform中这样的功能如何实现 求这个应该怎么写? qq空间的接口 关于c#书 导入txt文件时,会提示,该文件正被另一进程使用。 一个简单正则的问题 在VS环境XML与treeview怎么解决啊!急! 求助?点击淘宝阿里旺旺在线图标打开本地程序是如何实现的? 有个自身迭代出现了问题,无法理解啊 winform下gridview打印如何实现? 如何写一个类, 继承一个接口, 但不实现其中的方法?
OpenFileDialog file = new OpenFileDialog();
if (file.ShowDialog(this) == DialogResult.Cancel) return;
textbox.Text=file.FileName;LZ试试呗
{
OpenFileDialog dia = new OpenFileDialog();
dia.Multiselect = false;
if (dia.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
string fileName = dia.FileName;
this.txtFileName.Text = fileName;
}
}