Hi everyone,
I am developing a WPF application in my company.
I use RadControls for WPF Q3 2013 trial version.
I have written a sample project made up of a MainWindow and a UserControl.
The MainWindow contains a Button and I have written an handler to the Button's Click event.
Here is the MainWindow's code-behind :
I do not have to click the OK button in the MessageBox to close it because the MessageBox is automatically closed.
Why ?
The MessageBox is not automatically closed when the following line is missing : l_hostWindow.Close();
Thank you in advance for your help
I am developing a WPF application in my company.
I use RadControls for WPF Q3 2013 trial version.
I have written a sample project made up of a MainWindow and a UserControl.
The MainWindow contains a Button and I have written an handler to the Button's Click event.
Here is the MainWindow's code-behind :
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;using Telerik.Windows.Controls;namespace MessageBoxAutoClosed{ /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void Button_Click(object sender, RoutedEventArgs e) { UserControl1 l_userControl = new UserControl1(); RadWindow l_hostWindow = new RadWindow() { Owner = System.Windows.Application.Current.MainWindow, WindowStartupLocation = WindowStartupLocation.CenterOwner }; ScrollViewer l_scrollViewer = new ScrollViewer(); l_scrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; l_scrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; l_scrollViewer.Content = l_userControl; l_hostWindow.Content = l_scrollViewer; l_hostWindow.Show(); //l_hostWindow.Close(); MessageBox.Show("MessageBox", "MessageBox", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK); } }}I do not have to click the OK button in the MessageBox to close it because the MessageBox is automatically closed.
Why ?
The MessageBox is not automatically closed when the following line is missing : l_hostWindow.Close();
Thank you in advance for your help