הודעת שגיאה

ליאם711

New member
הודעת שגיאה

שלום לכולם אני מעוניין להציג הודעה על המסך של "כן ולא" אני כותב את הקוד הבא:
Dim ans As DialogResult = MessageBox.Show("Do you want to save the change?", "Manager", MessageBoxButtons.YesNo) If ans = DialogResult.Yes Then ConfigurationSettings.AppSettings.Set("ApplicationType", txtApplicationType.Text) End If​
אבל אני מקבל את השגיאה הבאה:
It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.​
כאשר ההודעה מתכוונת לשורה של ההצהרה DIM איך אני מתגבר על זה? תודה
 
למעלה