开发者

C# .net application openfile Dialog works in win xp not in win 7 (32 bit or 64 bit)

开发者 https://www.devze.com 2023-03-20 05:50 出处:网络
public void spawnVr_Monthly() { vrMonthlyProcessingThread = new Thread(new ThreadStart(process_Vr_Monthly_File));
public void spawnVr_Monthly() {
    vrMonthlyProcessingThread = new Thread(new ThreadStart(process_Vr_Monthly_File));
    vrMonthlyProcessingThread.Start();
}
public void process_Vr_Monthly_File() {
     OpenFileDialog vrmpf = new OpenFileDialog();
     vrmpf.AutoUpgradeEnabled = true;
     vrmpf.Title = "Select VR Monthly Parking file to process";
     vrmpf.Fil开发者_运维知识库ter = "VR Monthly Parking File (VRMTHY_OUT*.TXT|*.TXT";
 }


Do you have [STAThread] attribute on your Main() function?

And I think you'd better spawn this dialog on UI thread not just any background. Use SynchronizationContext or Control.Invoke() to run something on UI thread.

0

精彩评论

暂无评论...
验证码 换一张
取 消