[Mono-bugs] [Bug 82539][Maj] New - SaveFileDialog bug

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Aug 22 17:59:25 EDT 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by tquerci at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=82539

--- shadow/82539	2007-08-22 17:59:25.000000000 -0400
+++ shadow/82539.tmp.23566	2007-08-22 17:59:25.000000000 -0400
@@ -0,0 +1,109 @@
+Bug#: 82539
+Product: Mono: Class Libraries
+Version: 1.1
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com                            
+ReportedBy: tquerci at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: SaveFileDialog bug
+
+The SaveFileDialog class have a wrong behaviour in a particular condition.
+
+To reproduce the wrong behaviour using the sample file that I post here
+make the following instruction:
+
+- click the pushbutton, the SaveFileDialog appers
+- clear the filename
+- press the save pushbutton
+
+now, under window .NET engine the dialog still open waiting for a correct input
+under Mono (both windows and linux is the same) the dialog is closed
+while and I obtain sa FileName the old one. So I not know is the user
+press the "save" button or insert an empty filename.
+
+
+----------------------- sample file ------------------------
+using System;
+using System.Drawing;
+using System.Windows.Forms;
+using System.Collections;
+
+namespace test_winform
+{
+	public class MainClass : System.Windows.Forms.Form
+	{
+        private System.Windows.Forms.Panel panel1;
+		
+		private System.Windows.Forms.Button button;
+		private System.Windows.Forms.SaveFileDialog saveFileDialog;
+		public MainClass()
+		{
+			
+			this.InitializeComponent();
+		}
+
+        private void InitializeComponent()
+        {
+
+			this.panel1 = new System.Windows.Forms.Panel();
+
+			// 
+			// Form1
+			// 
+
+			this.panel1.Location = new System.Drawing.Point(0,0);
+			this.panel1.BorderStyle=System.Windows.Forms.BorderStyle.None;
+			
+			this.panel1.Name = "panel1";
+			this.panel1.Size = new System.Drawing.Size(1024,768);
+			this.panel1.TabIndex = 2;
+			
+			//
+			// Button
+			//
+			button=new System.Windows.Forms.Button();
+			button.Text = "Click Me";
+			button.ClientSize = new System.Drawing.Size(100, 100);
+			button.Location = new System.Drawing.Point(10, 10);
+			button.Click += new EventHandler(buottonClicked);
+			
+			this.Name = "Form1";
+			this.Text = "Show SaveFileDialog";
+			this.panel1.Controls.Add(button);
+
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+			this.ClientSize = new System.Drawing.Size(856, 573);
+			this.Controls.Add(this.panel1);
+			this.Name = "Form1";
+			this.Text = "Form1";
+
+			this.ResumeLayout(false);
+        }
+
+		private void buottonClicked(object o, EventArgs e) {
+			saveFileDialog=new System.Windows.Forms.SaveFileDialog();
+			
+			saveFileDialog.FileName="empty this field and press save.txt";
+			if (saveFileDialog.ShowDialog()==System.Windows.Forms.DialogResult.OK) {
+				System.Windows.Forms.MessageBox.Show("Save Pressed for File:
+"+saveFileDialog.FileName);
+			} else {
+				System.Windows.Forms.MessageBox.Show("Cancel Pressed");
+			}
+				
+		}
+		public static void Main(string[] args)
+		{
+			Application.Run(new MainClass());
+		}
+	}
+}


More information about the mono-bugs mailing list