/// <summary> /// Hides the drop down. /// </summary> public void HideDropDown() { if (dropDown != null) { dropDown.Hide(); } }
/// <summary> /// Hides the drop down. /// </summary> public void HideDropDown() { if (dropDown != null) { dropDown.Hide(); if (DropDownClosed != null) { DropDownClosed(this, EventArgs.Empty); } } }
private bool InternalProcessResizing(ref Message m, bool contentControl) { if (m.Msg == NativeMethods.WM_NCACTIVATE && m.WParam != IntPtr.Zero && _childPopup != null && _childPopup.Visible) { _childPopup.Hide(); } if (!Resizable && !NonInteractive) { return(false); } if (m.Msg == NativeMethods.WM_NCHITTEST) { return(OnNcHitTest(ref m, contentControl)); } else if (m.Msg == NativeMethods.WM_GETMINMAXINFO) { return(OnGetMinMaxInfo(ref m)); } return(false); }
private void Form1_Load(object sender, EventArgs e) { timer.Tick += new EventHandler(timer_Tick); // Every time timer ticks, timer_Tick will be called timer.Interval = 10000; // Timer will tick every 10 seconds timer.Enabled = true; // Enable the timer timer.Start(); InplacePopup = new Popup(SettingsPopup = new CSRAssistant.UserControls.Settings()); InplacePopup.Resizable = false; // code for folder browser SettingsPopup.btnBrowse.Click += (_sender, _e) => { FolderBrowserDialog folderBrowserdg = new FolderBrowserDialog(); if (folderBrowserdg.ShowDialog() == DialogResult.OK) { SettingsPopup.txtPath.Text = folderBrowserdg.SelectedPath; } }; SettingsPopup.btnServerBrowse.Click += (_sender, _e) => { FolderBrowserDialog folderBrowserdg = new FolderBrowserDialog(); folderBrowserdg.SelectedPath = @"\\192.168.006.2\d$\CSRAssistant\Biswajit"; if (folderBrowserdg.ShowDialog() == DialogResult.OK) { SettingsPopup.txtServerPath.Text = folderBrowserdg.SelectedPath; } }; // code for saving file location in config file SettingsPopup.btnSave.Click += (_sender, _e) => { try { if (Utils.IsDirectory(SettingsPopup.txtPath.Text)) { Configuration config = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath); if (config.AppSettings.Settings["localVoiceRecordsPath"].Value != null && config.AppSettings.Settings["localVoiceRecordsPath"].Value!="") { if (!Directory.Exists(SettingsPopup.txtPath.Text)) { Directory.CreateDirectory(SettingsPopup.txtPath.Text); } config.AppSettings.Settings.Add("localVoiceRecordsPath", SettingsPopup.txtPath.Text.Replace(",", string.Empty)); config.Save(ConfigurationSaveMode.Modified); SettingsPopup.txtPath.Text = config.AppSettings.Settings["localVoiceRecordsPath"].Value.Replace(",", string.Empty); } } else { MessageBox.Show("Invalid directory specified"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } InplacePopup.Hide(); }; SettingsPopup.btnServerSave.Click += (_sender, _e) => { try { if (Utils.IsDirectory(SettingsPopup.txtServerPath.Text)) { Configuration config = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath); if (config.AppSettings.Settings["ServerVoiceRecordsPath"].Value != null) { if (!Directory.Exists(SettingsPopup.txtServerPath.Text)) { Directory.CreateDirectory(SettingsPopup.txtServerPath.Text); } config.AppSettings.Settings.Add("ServerVoiceRecordsPath", SettingsPopup.txtServerPath.Text.Replace(",", string.Empty)); config.Save(ConfigurationSaveMode.Modified); SettingsPopup.txtServerPath.Text = config.AppSettings.Settings["ServerVoiceRecordsPath"].Value.Replace(",", string.Empty); } } else { MessageBox.Show("Invalid directory specified"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } InplacePopup.Hide(); }; Utils.ReadProperty(metroStyleManager1); SetLineSize(); if (!User.IsLoggedIn) { metroTile6.Text = "Login"; metroTile6.Refresh(); } else { metroTile6.Text = "Logout"; metroTile6.Refresh(); } }