Win7 旗舰版,32位os,ram 2g,已激活
在运行以前写的程序时,发现OpenFileDialog 无法打开,程序假死,需要强制关闭。加入调试代码(messagebox.show)后,能够正常显示aaa,bbb,ccc三个对话框,然后假死。
protected void OnOpen(Object o,EventArgs ea){
MessageBox.Show("aaa");
using(OpenFileDialog ofd=new OpenFileDialog ()){
MessageBox.Show("bbb");
ofd.Filter="XML资源文件(*.ResX)|*.resx";
MessageBox.Show("ccc");
if(DialogResult.OK==ofd.ShowDialog()){
MessageBox.Show("ddd");.........
同一个程序的其他对话框可以正常使用
using (AddDialog ad=new AddDialog()){
if(DialogResult.OK==ad.ShowDialog()){//定义部分
public class AddDialog:Dialog{
public TextBox _tb1,_tb2;
public AddDialog(){
Text="Add";请高手会诊。谢谢
QQ 22857266
在运行以前写的程序时,发现OpenFileDialog 无法打开,程序假死,需要强制关闭。加入调试代码(messagebox.show)后,能够正常显示aaa,bbb,ccc三个对话框,然后假死。
protected void OnOpen(Object o,EventArgs ea){
MessageBox.Show("aaa");
using(OpenFileDialog ofd=new OpenFileDialog ()){
MessageBox.Show("bbb");
ofd.Filter="XML资源文件(*.ResX)|*.resx";
MessageBox.Show("ccc");
if(DialogResult.OK==ofd.ShowDialog()){
MessageBox.Show("ddd");.........
同一个程序的其他对话框可以正常使用
using (AddDialog ad=new AddDialog()){
if(DialogResult.OK==ad.ShowDialog()){//定义部分
public class AddDialog:Dialog{
public TextBox _tb1,_tb2;
public AddDialog(){
Text="Add";请高手会诊。谢谢
QQ 22857266
没做过winform,路过
不过我现在系统是win2008R2,windows7对应的服务器版
VS2008
using System;
using System.Windows.Forms;
public class a{
public static void Main(){
using(OpenFileDialog ofd = new OpenFileDialog()){
ofd.Filter="All|*.*";
MessageBox.Show(ofd.Filter);
MessageBox.Show((DialogResult.OK==ofd.ShowDialog()).ToString());
}
}
}
重试刚才复制粘贴你的程序,依然没有问题
唯一与你不同的是我的系统是64位的
我打算把.net升级试试
谢谢viena的帮助