vb.net界面设计
来源:百度知道 编辑:UC知道 时间:2024/09/23 11:15:39
用vb.net做文件菜单中的“新建工程”想,做了第二个界面,在工程路径选择时设置了Button,属性text中设置为“浏览”,想点击此菜单时打开路径选择对话框,请问代码怎么写?
楼上说的是c#的
dim o as new openfiledialog
dim pathname as string '这用来保存获得的文件名
if o.showdialog=dislogresult.ok then '显示打开文件对话框
pathname=o.filename
end if
OpenFileDialog MyDialog = new OpenFileDialog();
//if the user clicks OK
if (MyDialog.ShowDialog() == DialogResult.OK)
{
}