Here are the examples of the csharp api System.Windows.Forms.Control.Hide() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1008 Examples
19
Source : EditorHost.cs
with Apache License 2.0
from Chem4Word
with Apache License 2.0
from Chem4Word
private void EditorHost_FormClosing(object sender, FormClosingEventArgs e)
{
string module = $"{_product}.{_clreplaced}.{MethodBase.GetCurrentMethod().Name}()";
if (DialogResult != DialogResult.OK && e.CloseReason == CloseReason.UserClosing)
{
if (elementHost1.Child is Chem4Word.ACME.Editor editor
&& editor.IsDirty)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("Do you wish to save your changes?");
sb.AppendLine(" Click 'Yes' to save your changes and exit.");
sb.AppendLine(" Click 'No' to discard your changes and exit.");
sb.AppendLine(" Click 'Cancel' to return to the form.");
DialogResult dr = UserInteractions.AskUserYesNoCancel(sb.ToString());
switch (dr)
{
case DialogResult.Cancel:
e.Cancel = true;
break;
case DialogResult.Yes:
DialogResult = DialogResult.OK;
var model = editor.EditedModel;
model.RescaleForCml();
// Replace any temporary Ids which are Guids
model.ReLabelGuids();
CMLConverter cc = new CMLConverter();
OutputValue = cc.Export(model);
Telemetry.Write(module, "Verbose", $"Result: {DialogResult}");
Hide();
editor = null;
break;
case DialogResult.No:
Telemetry.Write(module, "Verbose", $"Result: {DialogResult}");
editor = null;
break;
}
}
}
}
19
Source : Cdw800Settings.cs
with Apache License 2.0
from Chem4Word
with Apache License 2.0
from Chem4Word
private void btnOk_Click(object sender, EventArgs e)
{
string module = $"{_product}.{_clreplaced}.{MethodBase.GetCurrentMethod().Name}()";
Telemetry.Write(module, "Action", "Triggered");
try
{
EditorOptions.Save();
_dirty = false;
DialogResult = DialogResult.OK;
Hide();
}
catch (Exception ex)
{
new ReportError(Telemetry, TopLeft, module, ex).ShowDialog();
}
}
19
Source : OoXmlV4Settings.cs
with Apache License 2.0
from Chem4Word
with Apache License 2.0
from Chem4Word
private void Ok_Click(object sender, EventArgs e)
{
string module = $"{_product}.{_clreplaced}.{MethodBase.GetCurrentMethod().Name}()";
try
{
_dirty = false;
RendererOptions.Save();
DialogResult = DialogResult.OK;
Hide();
}
catch (Exception ex)
{
new ReportError(Telemetry, TopLeft, module, ex).ShowDialog();
}
}
19
Source : ChEBISettings.cs
with Apache License 2.0
from Chem4Word
with Apache License 2.0
from Chem4Word
private void btnOk_Click(object sender, EventArgs e)
{
string module = $"{_product}.{_clreplaced}.{MethodBase.GetCurrentMethod().Name}()";
Telemetry.Write(module, "Action", "Triggered");
try
{
SearcherOptions.Save();
_dirty = false;
DialogResult = DialogResult.OK;
Hide();
}
catch (Exception ex)
{
new ReportError(Telemetry, TopLeft, module, ex).ShowDialog();
}
}
19
Source : ExampleSettings.cs
with Apache License 2.0
from Chem4Word
with Apache License 2.0
from Chem4Word
private void btnOk_Click(object sender, EventArgs e)
{
string module = $"{_product}.{_clreplaced}.{MethodBase.GetCurrentMethod().Name}()";
try
{
SearcherOptions.Save();
_dirty = false;
DialogResult = DialogResult.OK;
Hide();
}
catch (Exception ex)
{
new ReportError(Telemetry, TopLeft, module, ex).ShowDialog();
}
}
19
Source : SearchPubChem.cs
with Apache License 2.0
from Chem4Word
with Apache License 2.0
from Chem4Word
private void Results_DoubleClick(object sender, EventArgs e)
{
string module = $"{_product}.{_clreplaced}.{MethodBase.GetCurrentMethod().Name}()";
try
{
Debug.WriteLine("Results_DoubleClick");
DialogResult = DialogResult.OK;
Hide();
}
catch (Exception ex)
{
new ReportError(Telemetry, TopLeft, module, ex).ShowDialog();
}
}
19
Source : Extensions.cs
with MIT License
from circles-arrows
with MIT License
from circles-arrows
public static void HideLoader(this Form parent, Form loader)
{
loader.Hide();
parent.Enabled = true;
}
19
Source : LuaOutputForm.cs
with GNU General Public License v3.0
from Cleric-K
with GNU General Public License v3.0
from Cleric-K
void LuaOutputFormFormClosing(object sender, FormClosingEventArgs e)
{
Hide();
e.Cancel = true;
}
19
Source : LuaOutputForm.cs
with GNU General Public License v3.0
from Cleric-K
with GNU General Public License v3.0
from Cleric-K
void ButtonCloseClick(object sender, EventArgs e)
{
Hide();
}
19
Source : MonitorForm.cs
with GNU General Public License v3.0
from Cleric-K
with GNU General Public License v3.0
from Cleric-K
void MonitorFormFormClosing(object sender, FormClosingEventArgs e)
{
Hide();
e.Cancel = true;
min = max = -1;
}
19
Source : MainForm.cs
with GNU General Public License v3.0
from Cleric-K
with GNU General Public License v3.0
from Cleric-K
void MainFormResize(object sender, EventArgs e)
{
if (config.MinimizeToTray && WindowState == FormWindowState.Minimized)
{
Hide();
notifyIcon.Visible = true;
}
}
19
Source : LoginForm.cs
with MIT License
from CmlLib
with MIT License
from CmlLib
private void UpdateSession(MSession session)
{
// Success to login!
var mainForm = new MainForm(session);
mainForm.FormClosed += (s, e) => this.Close();
mainForm.Show();
this.Hide();
}
19
Source : CheckUpdate.cs
with GNU General Public License v3.0
from CoderJoeW
with GNU General Public License v3.0
from CoderJoeW
private void button1_Click(object sender, EventArgs e) {
this.Hide();
}
19
Source : DeclarationViewWindow.cs
with MIT License
from codewitch-honey-crisis
with MIT License
from codewitch-honey-crisis
protected override void OnClick(EventArgs e)
{
base.OnClick(e);
if (HideOnClick) Hide();
}
19
Source : FindAndReplaceForm.cs
with MIT License
from codewitch-honey-crisis
with MIT License
from codewitch-honey-crisis
private void FindAndReplaceForm_FormClosing(object sender, FormClosingEventArgs e)
{ // Prevent dispose, as this form can be re-used
if (e.CloseReason != CloseReason.FormOwnerClosing)
{
if (this.Owner != null)
this.Owner.Select(); // prevent another app from being activated instead
e.Cancel = true;
Hide();
// Discard search region
_search.ClearScanRegion();
_editor.Refresh(); // must repaint manually
}
}
19
Source : MainForm.cs
with MIT License
from colinvella
with MIT License
from colinvella
private void SetFullScreen(bool fullScreen)
{
if (this.fullScreen == fullScreen)
return;
resizedCaptionFont = null;
this.fullScreen = fullScreen;
this.TopMost = fullScreen;
if (fullScreen)
{
if (!cartridgeUsesGun)
Cursor.Hide();
this.windowModePosition = new Point(this.Left, this.Top);
this.FormBorderStyle = FormBorderStyle.None;
this.MainMenuStrip.Hide();
this.statusStrip.Hide();
this.Left = this.Top = 0;
int screenWidth = Screen.PrimaryScreen.Bounds.Width;
int screenHeight = Screen.PrimaryScreen.Bounds.Height;
this.Width = screenWidth;
this.Height = screenHeight;
bufferSize.Width = screenHeight * 282 / 256;
bufferSize.Height = screenHeight + 1;
UpdateResizedScreenFilter();
}
else
{
Cursor.Show();
this.FormBorderStyle = FormBorderStyle.FixedSingle;
this.MainMenuStrip.Show();
this.statusStrip.Show();
SetScreen(screenSize, tvAspect);
this.Left = windowModePosition.X;
this.Top = windowModePosition.Y;
}
}
19
Source : ToolStripStatusHistoryLabel.cs
with MIT License
from colinvella
with MIT License
from colinvella
private void ConstructDropDownForm()
{
dropDownForm = new Form();
dropDownForm.FormBorderStyle = FormBorderStyle.FixedSingle;
dropDownForm.StartPosition = FormStartPosition.Manual;
dropDownForm.ControlBox = false;
statusTextBox = new TextBox();
statusTextBox.ReadOnly = true;
statusTextBox.Multiline = true;
statusTextBox.ScrollBars = ScrollBars.Both;
statusTextBox.Dock = DockStyle.Fill;
statusTextBox.LostFocus += (sender, e) => dropDownForm.Hide();
dropDownForm.Controls.Add(statusTextBox);
}
19
Source : win11_downloadSelection.cs
with GNU General Public License v3.0
from coofcookie
with GNU General Public License v3.0
from coofcookie
private void btnDownloadSystem_Click(object sender, EventArgs e) {
btnDownloadSystem.Text = "Please wait...";
btnDownloadSystem.Enabled = false;
string urlDownload;
urlDownload = "https://www.microsoft.com/" + "en-US" +
"/api/controls/contentinclude/html?pageId=a224afab-2097-4dfa-a2ba-463eb191a285&host=www.microsoft.com&segments=software-download,windows11&query=&action=GetProductDownloadLinksBySku";
urlDownload += "&sessionId=" + guid;
urlDownload += "&skuId=" + languages[listLanguages.SelectedIndex].id;
urlDownload += "&language=" + languages[listLanguages.SelectedIndex].name;
urlDownload += "&sdVersion=2";
var webClient = new WebClient();
var downloadHtml = webClient.DownloadString(urlDownload);
var pattern = "(?s)(<input.*?></input>)";
var downloadFiltered = Regex.Match(downloadHtml, pattern).Groups[1].Value;
downloadFiltered = "<inputs>" + downloadFiltered + "</inputs>";
downloadFiltered = downloadFiltered.Replace("IsoX64", ""x64"");
downloadFiltered = downloadFiltered.Replace("clreplaced=product-download-hidden", "");
downloadFiltered = downloadFiltered.Replace("type=hidden", "");
downloadFiltered = downloadFiltered.Replace(" ", " ");
var downloadXml = new XmlDoreplacedent();
downloadXml.LoadXml(downloadFiltered);
foreach (XmlNode downloadLink in downloadXml.GetElementsByTagName("input"))
foreach (XmlAttribute downloadAttribute in downloadLink.Attributes)
if (downloadAttribute.Value.StartsWith("{") && downloadAttribute.Value.Contains("Uri")) {
dynamic downloadJson = JsonConvert.DeserializeObject(downloadAttribute.Value);
globals.downloadURL = downloadJson["Uri"];
Hide();
var downloadSystem = new win11_downloadSystem();
downloadSystem.Show();
}
}
19
Source : win11_downloadSystem.cs
with GNU General Public License v3.0
from coofcookie
with GNU General Public License v3.0
from coofcookie
private void downloadCompleted(object sender, AsyncCompletedEventArgs e) {
BeginInvoke((MethodInvoker) delegate {
globals.isoPath = Directory.GetCurrentDirectory() + "/win11.iso";
Hide();
var installSystem = new win11_installSystem();
installSystem.Show();
});
}
19
Source : win11_upgradeSelection.cs
with GNU General Public License v3.0
from coofcookie
with GNU General Public License v3.0
from coofcookie
private void btn_selectIso_Click(object sender, EventArgs e) {
using (var fileDialog = new OpenFileDialog()) {
fileDialog.InitialDirectory = "c:\\";
fileDialog.Filter = "ISO file (*.iso)|*.iso";
fileDialog.FilterIndex = 1;
if (fileDialog.ShowDialog() == DialogResult.OK) {
globals.isoPath = fileDialog.FileName;
Hide();
var installSystem = new win11_installSystem();
installSystem.Show();
}
}
}
19
Source : win11_upgradeSelection.cs
with GNU General Public License v3.0
from coofcookie
with GNU General Public License v3.0
from coofcookie
private void btn_downloadIso_Click(object sender, EventArgs e) {
Hide();
var downloadSelection = new win11_downloadSelection();
downloadSelection.Show();
}
19
Source : DShowForm.cs
with GNU General Public License v2.0
from CrazyKTV
with GNU General Public License v2.0
from CrazyKTV
private void ToggleFullscreen()
{
if (this.FormBorderStyle == FormBorderStyle.None)
{
this.WindowState = winState;
this.Hide();
this.FormBorderStyle = FormBorderStyle.Sizable;
this.TopMost = false;
this.Location = winLoc;
this.Width = winWidth;
this.Height = winHeight;
elementHost.Dock = DockStyle.None;
elementHost.Location = new System.Drawing.Point(12, 12);
elementHost.Width = eHostWidth;
elementHost.Height = eHostHeight;
elementHost.Anchor = AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Left;
Player_ProgressTrackBar.TrackBarValue = Player_ProgressTrackBar.TrackBarValue;
Player_ProgressTrackBar.ProgressBarValue = Player_ProgressTrackBar.ProgressBarValue;
Cursor.Show();
this.Show();
}
else
{
winState = this.WindowState;
winLoc = this.Location;
winWidth = this.Width;
winHeight = this.Height;
eHostWidth = elementHost.Width;
eHostHeight = elementHost.Height;
this.Hide();
this.FormBorderStyle = FormBorderStyle.None;
this.TopMost = true;
this.WindowState = FormWindowState.Normal;
this.WindowState = FormWindowState.Maximized;
elementHost.Dock = DockStyle.Fill;
Cursor.Hide();
this.Show();
}
}
19
Source : SongAddDataGridView.cs
with GNU General Public License v2.0
from CrazyKTV
with GNU General Public License v2.0
from CrazyKTV
private void SongAdd_DataGridView_ContextMenuItem_RightClick(object sender, EventArgs e)
{
string file = SongAdd_DataGridView.Rows[SongAdd_DataGridView.CurrentCell.RowIndex].Cells["Song_SrcPath"].Value.ToString();
string SongPath = Path.GetDirectoryName(file);
string SongFileName = Path.GetFileName(file);
switch (sender.ToString())
{
case "開啟資料夾":
if (!Directory.Exists(SongPath) || !File.Exists(file))
{
SongAdd_Tooltip_Label.Text = "選取歌曲的資料夾或檔案不存在...";
}
else
{
string arg = "/select, " + file;
Process.Start("explorer", arg);
}
break;
case "播放檔案":
if (!File.Exists(file))
{
SongAdd_Tooltip_Label.Text = "【" + SongFileName + "】檔案不存在...";
}
else
{
int i = SongAdd_DataGridView.CurrentCell.RowIndex;
string SongId = SongAdd_DataGridView.Rows[i].Cells["Song_Id"].Value.ToString();
string SongLang = SongAdd_DataGridView.Rows[i].Cells["Song_Lang"].Value.ToString();
string SongSinger = SongAdd_DataGridView.Rows[i].Cells["Song_Singer"].Value.ToString();
string SongSongName = SongAdd_DataGridView.Rows[i].Cells["Song_SongName"].Value.ToString();
string SongTrack = SongAdd_DataGridView.Rows[i].Cells["Song_Track"].Value.ToString();
string SongVolume = SongAdd_DataGridView.Rows[i].Cells["Song_Volume"].Value.ToString();
string SongReplayGain = SongAdd_DataGridView.Rows[i].Cells["Song_ReplayGain"].Value.ToString();
string SongFilePath = file;
List<string> PlayerSongInfoList = new List<string>() { SongId, SongLang, SongSinger, SongSongName, SongTrack, SongVolume, SongReplayGain, SongFilePath, i.ToString(), "SongAdd" };
Global.PlayerUpdateSongValueList = new List<string>();
if (Global.MainCfgPlayerCore == "1")
{
DShowForm newPlayerForm = new DShowForm(this, PlayerSongInfoList);
newPlayerForm.Show();
}
this.Hide();
}
break;
case "刪除資料列":
if (MessageBox.Show("你確定要刪除資料嗎?", "刪除提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
foreach (DataGridViewRow row in SongAdd_DataGridView.SelectedRows)
{
SongAdd_DataGridView.Rows.Remove(row);
}
if (SongAdd_DataGridView.RowCount == 0)
{
SongAdd_DataGridView.DataSource = null;
SongAdd_Add_Button.Enabled = false;
SongAdd_InitializeEditControl();
SongAdd_Tooltip_Label.Text = "已無歌曲可加入!";
}
}
break;
}
}
19
Source : SongQueryDataGridView.cs
with GNU General Public License v2.0
from CrazyKTV
with GNU General Public License v2.0
from CrazyKTV
private void SongQuery_DataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
if (SongQuery_EditMode_CheckBox.Checked == false)
{
if (e.RowIndex < 0) return;
int i = e.RowIndex;
string SongPath = SongQuery_DataGridView.Rows[i].Cells["Song_Path"].Value.ToString();
string SongFileName = SongQuery_DataGridView.Rows[i].Cells["Song_FileName"].Value.ToString();
string file = Path.Combine(SongPath, SongFileName);
if (!File.Exists(file))
{
SongQuery_QueryStatus_Label.Text = "【" + SongFileName + "】檔案不存在...";
}
else
{
string SongId = SongQuery_DataGridView.Rows[i].Cells["Song_Id"].Value.ToString();
string SongLang = SongQuery_DataGridView.Rows[i].Cells["Song_Lang"].Value.ToString();
string SongSinger = SongQuery_DataGridView.Rows[i].Cells["Song_Singer"].Value.ToString();
string SongSongName = SongQuery_DataGridView.Rows[i].Cells["Song_SongName"].Value.ToString();
string SongTrack = SongQuery_DataGridView.Rows[i].Cells["Song_Track"].Value.ToString();
string SongVolume = SongQuery_DataGridView.Rows[i].Cells["Song_Volume"].Value.ToString();
string SongReplayGain = SongQuery_DataGridView.Rows[i].Cells["Song_ReplayGain"].Value.ToString();
string SongFilePath = Path.Combine(SongPath, SongFileName);
List<string> PlayerSongInfoList = new List<string>() { SongId, SongLang, SongSinger, SongSongName, SongTrack, SongVolume, SongReplayGain, SongFilePath, i.ToString(), "SongQuery" };
Global.PlayerUpdateSongValueList = new List<string>();
if (Global.MainCfgPlayerCore == "1")
{
DShowForm newPlayerForm = new DShowForm(this, PlayerSongInfoList);
newPlayerForm.Show();
}
this.Hide();
}
}
}
19
Source : SongQueryDataGridView.cs
with GNU General Public License v2.0
from CrazyKTV
with GNU General Public License v2.0
from CrazyKTV
private void SongQuery_DataGridView_ContextMenuItem_RightClick(object sender, EventArgs e)
{
string SongPath = SongQuery_DataGridView.Rows[SongQuery_DataGridView.CurrentCell.RowIndex].Cells["Song_Path"].Value.ToString();
string SongFileName = SongQuery_DataGridView.Rows[SongQuery_DataGridView.CurrentCell.RowIndex].Cells["Song_FileName"].Value.ToString();
string file = Path.Combine(SongPath, SongFileName);
switch (sender.ToString())
{
case "開啟資料夾":
if (!Directory.Exists(SongPath) || !File.Exists(file))
{
SongQuery_QueryStatus_Label.Text = "選取歌曲的資料夾或檔案不存在...";
}
else
{
string arg = "/select, " + file;
Process.Start("explorer", arg);
}
break;
case "播放檔案":
if (!File.Exists(file))
{
SongQuery_QueryStatus_Label.Text = "【" + SongFileName + "】檔案不存在...";
}
else
{
int i = SongQuery_DataGridView.CurrentCell.RowIndex;
string SongId = SongQuery_DataGridView.Rows[i].Cells["Song_Id"].Value.ToString();
string SongLang = SongQuery_DataGridView.Rows[i].Cells["Song_Lang"].Value.ToString();
string SongSinger = SongQuery_DataGridView.Rows[i].Cells["Song_Singer"].Value.ToString();
string SongSongName = SongQuery_DataGridView.Rows[i].Cells["Song_SongName"].Value.ToString();
string SongTrack = SongQuery_DataGridView.Rows[i].Cells["Song_Track"].Value.ToString();
string SongVolume = SongQuery_DataGridView.Rows[i].Cells["Song_Volume"].Value.ToString();
string SongReplayGain = SongQuery_DataGridView.Rows[i].Cells["Song_ReplayGain"].Value.ToString();
string SongFilePath = Path.Combine(SongPath, SongFileName);
List<string> PlayerSongInfoList = new List<string>() { SongId, SongLang, SongSinger, SongSongName, SongTrack, SongVolume, SongReplayGain, SongFilePath, i.ToString(), "SongQuery" };
Global.PlayerUpdateSongValueList = new List<string>();
if (Global.MainCfgPlayerCore == "1")
{
DShowForm newPlayerForm = new DShowForm(this, PlayerSongInfoList);
newPlayerForm.Show();
}
this.Hide();
}
break;
case "查詢此歌手所有歌曲":
string SingerName = SongQuery_DataGridView.SelectedRows[0].Cells["Song_Singer"].Value.ToString();
SongQuery_QueryType_ComboBox.SelectedValue = 2;
SongQuery_QueryValue_TextBox.Text = SingerName;
SongQuery_QueryFilter_ComboBox.SelectedValue = 1;
SongQuery_EditMode_CheckBox.Checked = false;
SongQuery_Query_Button_Click(new Button(), new EventArgs());
break;
case "刪除資料列":
string MessageText = (Global.SongMgrSongAddMode != "3") ? "你確定要刪除歌曲資料及歌曲檔案嗎?" : "你確定要刪除歌曲資料嗎?";
if (MessageBox.Show(MessageText, "刪除提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
List<string> SongIdlist = new List<string>();
List<string> SongFilelist = new List<string>();
List<string> RemoveSongIdlist = new List<string>();
foreach (DataGridViewRow row in SongQuery_DataGridView.SelectedRows)
{
SongIdlist.Add(row.Cells["Song_Id"].Value.ToString());
SongFilelist.Add(row.Cells["Song_FullPath"].Value.ToString());
}
SongQuery.CreateSongDataTable();
Common_SwitchSetUI(false);
var task = Task<List<string>>.Factory.StartNew(() => SongQuery_SongRemove(SongIdlist, SongFilelist));
RemoveSongIdlist = task.Result;
using (DataTable dt = (DataTable)SongQuery_DataGridView.DataSource)
{
List<DataRow> RemoveRomList = new List<DataRow>();
foreach (DataRow row in dt.Rows)
{
if (RemoveSongIdlist.IndexOf(row["Song_Id"].ToString()) > -1)
{
RemoveRomList.Add(row);
}
}
foreach (DataRow row in RemoveRomList)
{
dt.Rows.Remove(row);
}
RemoveRomList.Clear();
}
if (SongQuery_DataGridView.RowCount == 0)
{
SongQuery_DataGridView.DataSource = null;
if (SongQuery_DataGridView.Columns.Count > 0) SongQuery_DataGridView.Columns.Remove("Song_FullPath");
SongQuery_InitializeEditControl();
SongQuery_QueryStatus_Label.Text = "已無歌曲可編輯!";
}
SongQuery.DisposeSongDataTable();
Common_SwitchSetUI(true);
}
break;
case "從我的最愛移除":
if (MessageBox.Show("你確定要從【" + SongQuery_FavoriteQuery_ComboBox.Text + "】移除我的最愛歌曲嗎?", "刪除提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
string UserId = "";
var query = from row in Global.FavoriteUserDT.AsEnumerable()
where row.Field<string>("User_Name").Equals(SongQuery_FavoriteQuery_ComboBox.Text)
select row;
if (query.Count<DataRow>() > 0)
{
foreach (DataRow row in query)
{
UserId = row["User_Id"].ToString();
break;
}
}
List<string> SongIdlist = new List<string>();
foreach (DataGridViewRow row in SongQuery_DataGridView.SelectedRows)
{
SongIdlist.Add(row.Cells["Song_Id"].Value.ToString());
SongQuery_DataGridView.Rows.Remove(row);
}
Task.Factory.StartNew(() => SongQuery_FavoriteRemove(SongIdlist, UserId));
}
break;
}
}
19
Source : taskForm.cs
with MIT License
from crouvpony47
with MIT License
from crouvpony47
private async void galleryDownloadBtn_Click(object sender, EventArgs e)
{
Hide();
string link = galleryUrlBox.Text;
try
{
var pr = await AppCore.Core.ProcessGenericUrl(link, galleryDescrCheckBox.Checked, galleryUpdateCheckBox.Checked);
string msg = "Downloaded {0} files.";
if (pr.failedToDownload.Count > 0 || pr.failedToGetPage.Count > 0)
msg += " However, some files were not downloaded, those submission IDs are stored in get_sub_page_failed.log and download_failed.log";
Show();
MessageBox.Show(msg.Replace("{0}", pr.processedPerfectly.ToString()));
}
catch (Exception ex)
{
Show();
MessageBox.Show(ex.Message);
return;
}
}
19
Source : authForm.cs
with MIT License
from crouvpony47
with MIT License
from crouvpony47
void OnAuthSuccessful()
{
Hide();
taskForm tf = new taskForm(this, AppCore.Core.defaultUserId);
tf.Show();
}
19
Source : taskForm.cs
with MIT License
from crouvpony47
with MIT License
from crouvpony47
private async void submUrlsDownloadBtn_Click(object sender, EventArgs e)
{
Hide();
List<string> subs = new List<string>(submUrlsTextBox.Lines);
var pr = await AppCore.Core.ProcessSubmissionsList(subs, submUrlsDescrCheckBox.Checked, submUrlsUpdateCheckBox.Checked);
string msg = "Downloaded {0} files.";
if (pr.failedToDownload.Count > 0 || pr.failedToGetPage.Count > 0)
msg += " However, some files were not downloaded, those submission IDs are stored in get_sub_page_failed.log and download_failed.log";
Show();
MessageBox.Show(msg.Replace("{0}", pr.processedPerfectly.ToString()));
//submUrlsUpdateCheckBox.Visible = false;
//submUrlsUpdateCheckBox.Checked = false; // v.0.5.1.2 hack
}
19
Source : PropertyCollectionForm.cs
with MIT License
from CslaGenFork
with MIT License
from CslaGenFork
protected override CollectionForm CreateCollectionForm()
{
_form = base.CreateCollectionForm();
HandleFormCollectionType();
// hook events for expanding Criteria properties hierarchy
if (_collectionType == typeof (Criteria))
{
foreach (Control control in _form.Controls)
{
if (control is TableLayoutPanel)
{
foreach (var panelControl in control.Controls)
{
if (panelControl is ListBox)
{
((ListBox) panelControl).SelectedIndexChanged += OnIndexChanged;
}
else if (panelControl is TableLayoutPanel)
{
var layoutPanel = (TableLayoutPanel) panelControl;
foreach (var tableControl in layoutPanel.Controls)
{
if (tableControl is Button)
{
var button = (Button) tableControl;
if (button.Text.IndexOf("Add") > 0 || button.Text.IndexOf("Remove") > 0)
button.Click += OnItemAddedOrRemoved;
}
}
}
else if (panelControl is PropertyGrid)
{
((PropertyGrid) panelControl).SelectedGridItemChanged += OnGridItemChanged;
}
}
}
}
}
else if (_collectionType == typeof(ValueProperty) || _collectionType == typeof(ChildProperty))
{
foreach (Control control in _form.Controls)
{
if (control is TableLayoutPanel)
{
foreach (var panelControl in control.Controls)
{
if (panelControl is PropertyGrid)
{
((PropertyGrid) panelControl).SelectedGridItemChanged += OnGridItemChangedProperty;
}
if (panelControl is TableLayoutPanel)
{
var layoutPanel = (TableLayoutPanel)panelControl;
if (layoutPanel.Name == "okCancelTableLayoutPanel")
{
foreach (var tableControl in layoutPanel.Controls)
{
if (tableControl is Button)
{
var button = (Button) tableControl;
if (button.Name == "cancelButton" || button.Name == "okButton")
{
exitButton[button.Name] = button;
button.Click += ExitButtonClickHandler;
}
}
}
}
}
}
}
}
}
/*else if (_collectionType == typeof (BusinessRuleProperty))
{
// hide Add & Remove buttons
foreach (Control control in _form.Controls)
{
if (control is TableLayoutPanel)
{
foreach (var panelControl in control.Controls)
{
if (panelControl is TableLayoutPanel)
{
var layoutPanel = (TableLayoutPanel) panelControl;
foreach (var tableControl in layoutPanel.Controls)
{
if (tableControl is Button)
{
var button = (Button) tableControl;
if (button.Text.IndexOf("Add") > 0 || button.Text.IndexOf("Remove") > 0)
{
button.Hide();
button.Enabled = false;
}
}
}
}
}
}
}
}*/
else if (_collectionType == typeof(BusinessRuleConstructor))
{
// hide Add & Remove buttons
foreach (Control control in _form.Controls)
{
if (control is TableLayoutPanel)
{
foreach (var panelControl in control.Controls)
{
if (panelControl is TableLayoutPanel)
{
var layoutPanel = (TableLayoutPanel)panelControl;
if (layoutPanel.Name == "addRemoveTableLayoutPanel")
{
foreach (var tableControl in layoutPanel.Controls)
{
if (tableControl is Button)
{
var button = (Button) tableControl;
if (button.Name == "addButton" || button.Name == "removeButton")
{
button.Hide();
button.Enabled = false;
}
}
}
}
}
}
}
}
}
var formType = _form.GetType();
//Get a reference to the private fieldtype propertyBrowser
//This is the PropertGrid inside the CollectionForm
var fieldInfo = formType.GetField("propertyBrowser", BindingFlags.NonPublic | BindingFlags.Instance);
if (fieldInfo != null)
{
_propGrid = (PropertyGrid) fieldInfo.GetValue(_form);
if (_propGrid != null)
{
_propGrid.ToolbarVisible = true;
_propGrid.HelpVisible = true;
_propGrid.PropertySort = PropertySort.Categorized;
_propGrid.PropertySortChanged += OnSort;
_propGrid.SelectedObjectsChanged += OnSelect;
/*//Get the property grid's type.
//This is a vsPropertyGrid located in System.Windows.Forms.Design
Type propertyGridType = _propGrid.GetType();
//Get a reference to the non-public property ToolStripRenderer
PropertyInfo propertyInfo = propertyGridType.GetProperty("ToolStripRenderer", BindingFlags.NonPublic | BindingFlags.Instance);
if (propertyInfo != null)
{
//replacedign a ToolStripProfessionalRenderer with our custom color table
propertyInfo.SetValue(_propGrid, new ToolStripProfessionalRenderer(new CustomColorTable()), null);
}*/
}
}
_form.Shown += OnFormShow;
return _form;
}
19
Source : PropertyCollectionForm.cs
with MIT License
from CslaGenFork
with MIT License
from CslaGenFork
protected override CollectionForm CreateCollectionForm()
{
_form = base.CreateCollectionForm();
HandleFormCollectionType();
// hook events for expanding Criteria properties hierarchy
if (_collectionType == typeof (Criteria))
{
foreach (Control control in _form.Controls)
{
if (control is TableLayoutPanel)
{
foreach (var panelControl in control.Controls)
{
if (panelControl is ListBox)
{
((ListBox) panelControl).SelectedIndexChanged += OnIndexChanged;
}
else if (panelControl is TableLayoutPanel)
{
var layoutPanel = (TableLayoutPanel) panelControl;
foreach (var tableControl in layoutPanel.Controls)
{
if (tableControl is Button)
{
var button = (Button) tableControl;
if (button.Text.IndexOf("Add", StringComparison.InvariantCulture) > 0 ||
button.Text.IndexOf("Remove", StringComparison.InvariantCulture) > 0)
button.Click += OnItemAddedOrRemoved;
}
}
}
else if (panelControl is PropertyGrid)
{
((PropertyGrid) panelControl).SelectedGridItemChanged += OnGridItemChanged;
}
}
}
}
}
else if (_collectionType == typeof(ValueProperty) || _collectionType == typeof(ChildProperty))
{
foreach (Control control in _form.Controls)
{
if (control is TableLayoutPanel)
{
foreach (var panelControl in control.Controls)
{
if (panelControl is PropertyGrid)
{
((PropertyGrid) panelControl).SelectedGridItemChanged += OnGridItemChangedProperty;
}
if (panelControl is TableLayoutPanel)
{
var layoutPanel = (TableLayoutPanel)panelControl;
if (layoutPanel.Name == "okCancelTableLayoutPanel")
{
foreach (var tableControl in layoutPanel.Controls)
{
if (tableControl is Button)
{
var button = (Button) tableControl;
if (button.Name == "cancelButton" || button.Name == "okButton")
{
_exitButton[button.Name] = button;
button.Click += ExitButtonClickHandler;
}
}
}
}
}
}
}
}
}
/*else if (_collectionType == typeof (BusinessRuleProperty))
{
// hide Add & Remove buttons
foreach (Control control in _form.Controls)
{
if (control is TableLayoutPanel)
{
foreach (var panelControl in control.Controls)
{
if (panelControl is TableLayoutPanel)
{
var layoutPanel = (TableLayoutPanel) panelControl;
foreach (var tableControl in layoutPanel.Controls)
{
if (tableControl is Button)
{
var button = (Button) tableControl;
if (button.Text.IndexOf("Add") > 0 || button.Text.IndexOf("Remove") > 0)
{
button.Hide();
button.Enabled = false;
}
}
}
}
}
}
}
}*/
else if (_collectionType == typeof(BusinessRuleConstructor))
{
// hide Add & Remove buttons
foreach (Control control in _form.Controls)
{
if (control is TableLayoutPanel)
{
foreach (var panelControl in control.Controls)
{
if (panelControl is TableLayoutPanel)
{
var layoutPanel = (TableLayoutPanel)panelControl;
if (layoutPanel.Name == "addRemoveTableLayoutPanel")
{
foreach (var tableControl in layoutPanel.Controls)
{
if (tableControl is Button)
{
var button = (Button) tableControl;
if (button.Name == "addButton" || button.Name == "removeButton")
{
button.Hide();
button.Enabled = false;
}
}
}
}
}
}
}
}
}
var formType = _form.GetType();
//Get a reference to the private fieldtype propertyBrowser
//This is the PropertGrid inside the CollectionForm
var fieldInfo = formType.GetField("propertyBrowser", BindingFlags.NonPublic | BindingFlags.Instance);
if (fieldInfo != null)
{
_propGrid = (PropertyGrid) fieldInfo.GetValue(_form);
if (_propGrid != null)
{
_propGrid.ToolbarVisible = true;
_propGrid.HelpVisible = true;
_propGrid.PropertySort = PropertySort.Categorized;
_propGrid.PropertySortChanged += OnSort;
_propGrid.SelectedObjectsChanged += OnSelect;
/*//Get the property grid's type.
//This is a vsPropertyGrid located in System.Windows.Forms.Design
Type propertyGridType = _propGrid.GetType();
//Get a reference to the non-public property ToolStripRenderer
PropertyInfo propertyInfo = propertyGridType.GetProperty("ToolStripRenderer", BindingFlags.NonPublic | BindingFlags.Instance);
if (propertyInfo != null)
{
//replacedign a ToolStripProfessionalRenderer with our custom color table
propertyInfo.SetValue(_propGrid, new ToolStripProfessionalRenderer(new CustomColorTable()), null);
}*/
}
}
_form.Shown += OnFormShow;
return _form;
}
19
Source : Form1.cs
with MIT License
from ctsecurity
with MIT License
from ctsecurity
private void Form1_Load(object sender, EventArgs e)
{
//this.Show();
this.Hide();
//this.ShowDialog();
port = 1338;
//Thread stopSucking = new Thread(new ThreadStart(startListening));
while (true)
{
try
{
//if (!ircBotIsRunning)
//{
// ircServer = "irc.gamesurge.net";
// ircPort = 6667;
// ircNick = "DarkTussin";
// debuggyThread = new Thread(new ThreadStart(debuggyMethod));
// debuggyThread.Start();
// ircWatcher = new Thread(new ThreadStart(startIRCBot));
// ircWatcher.Start();
//}
startListening();
//stopSucking.Start();
//stopSucking.Join();
//Thread.Sleep(1000);
}
catch (Exception)
{
//if (stopSucking.IsAlive)
// stopSucking.Abort();
}
}
//startListening();
}
19
Source : AutoComplete.cs
with Apache License 2.0
from cyanide-studio
with Apache License 2.0
from cyanide-studio
public bool Close()
{
if (form.Visible)
{
form.Hide();
return true;
}
return false;
}
19
Source : ESMessager.cs
with MIT License
from d-mod
with MIT License
from d-mod
private void Exit(object sender, EventArgs e) {
Hide();
}
19
Source : TSMMCMockup.cs
with MIT License
from dahall
with MIT License
from dahall
private void ShowPanel(Control panel)
{
curPanel?.Hide();
curPanel = panel;
var tasks = panel as ISupportTasks;
if (tasks != null)
{
tasks.TaskService = taskService;
SetActionMenu(tasks.MenuItems);
}
panel.Show();
}
19
Source : DwmApiTests.cs
with MIT License
from dahall
with MIT License
from dahall
[Test()]
public void DwmExtendFrameIntoClientAreaTest()
{
var wnd = new Form { Size = new Size(50, 50), TopMost = true, ControlBox = false, FormBorderStyle = FormBorderStyle.None };
wnd.Show();
Thread.Sleep(1000);
var margins = new MARGINS(10);
var err = DwmExtendFrameIntoClientArea(wnd.Handle, margins);
replacedert.That(err.Succeeded);
wnd.Hide();
}
19
Source : DwmApiTests.cs
with MIT License
from dahall
with MIT License
from dahall
[Test()]
public void DwmGetWindowAttributeTest()
{
var wnd = new Form { Size = new Size(50, 50), TopMost = true, ControlBox = false, FormBorderStyle = FormBorderStyle.None };
wnd.Show();
var err = DwmGetWindowAttribute(wnd.Handle, DWMWINDOWATTRIBUTE.DWMWA_CAPTION_BUTTON_BOUNDS, out RECT r2);
if (err.Failed) TestContext.WriteLine($"Err:DWMWA_CAPTION_BUTTON_BOUNDS={err}");
replacedert.That(err.Succeeded);
err = DwmGetWindowAttribute(wnd.Handle, DWMWINDOWATTRIBUTE.DWMWA_NCRENDERING_ENABLED, out bool b2);
if (err.Failed) TestContext.WriteLine($"Err:DWMWA_NCRENDERING_ENABLE={err}");
replacedert.That(err.Succeeded);
err = DwmGetWindowAttribute(wnd.Handle, DWMWINDOWATTRIBUTE.DWMWA_CLOAKED, out DWM_CLOAKED i2);
if (err.Failed) TestContext.WriteLine($"Err:DWMWA_NCRENDERING_POLICY={err}");
replacedert.That(err.Succeeded);
wnd.Hide();
}
19
Source : DwmApiTests.cs
with MIT License
from dahall
with MIT License
from dahall
[Test()]
public void DwmSetWindowAttributeTest()
{
var wnd = new Form { Size = new Size(50, 50), TopMost = true, ControlBox = false, FormBorderStyle = FormBorderStyle.None };
wnd.Show();
var err = DwmSetWindowAttribute(wnd.Handle, DWMWINDOWATTRIBUTE.DWMWA_CLOAK, true);
if (err.Failed) TestContext.WriteLine($"Err:DWMWA_CLOAK={err}");
replacedert.That(err.Succeeded);
err = DwmSetWindowAttribute(wnd.Handle, DWMWINDOWATTRIBUTE.DWMWA_NCRENDERING_POLICY, DWMNCRENDERINGPOLICY.DWMNCRP_USEWINDOWSTYLE);
if (err.Failed) TestContext.WriteLine($"Err:DWMWA_NCRENDERING_POLICY={err}");
replacedert.That(err.Succeeded);
wnd.Hide();
}
19
Source : DwmApiTests.cs
with MIT License
from dahall
with MIT License
from dahall
[Test()]
public void DwmEnableBlurBehindWindowTest()
{
var wnd = new Form { Size = new Size(50, 50), TopMost = true, ControlBox = false, FormBorderStyle = FormBorderStyle.None };
wnd.Show();
Thread.Sleep(1000);
var bb = new DWM_BLURBEHIND(true);
var err = DwmEnableBlurBehindWindow(wnd.Handle, bb);
replacedert.That(err.Succeeded);
Thread.Sleep(1000);
using (var g = wnd.CreateGraphics())
{
bb.SetRegion(g, new Region(new Rectangle(0, 0, 20, 20)));
err = DwmEnableBlurBehindWindow(wnd.Handle, bb);
replacedert.That(err.Succeeded);
Thread.Sleep(1000);
}
var bb2 = new DWM_BLURBEHIND(false);
err = DwmEnableBlurBehindWindow(wnd.Handle, bb2);
replacedert.That(err.Succeeded);
Thread.Sleep(1000);
wnd.Hide();
}
19
Source : CustomComboBox.cs
with MIT License
from dahall
with MIT License
from dahall
public void Hide()
{
if (dropDown != null && dropDown.Visible)
{
dropDown.Hide();
DisposeHost();
}
}
19
Source : ProgressDialog.cs
with MIT License
from dahall
with MIT License
from dahall
public override void Reset()
{
if (cancelToken != null && !cancelToken.IsCancellationRequested)
cancelToken.Cancel();
if (progressDlg.Visible)
progressDlg.Hide();
cancelToken = null;
parent = null;
running = false;
}
19
Source : ProgressDialog.cs
with MIT License
from dahall
with MIT License
from dahall
private void UpdateProgress(ProgressEventArgs p)
{
if (p.PercentComplete == 100)
{
if (progressDlg.Visible)
progressDlg.Hide();
}
else
{
if (!progressDlg.Visible)
progressDlg.ShowDialog(parent);
progressDlg.PercentComplete = p.PercentComplete;
progressDlg.StatusText = p.StatusText;
progressDlg.MacroPercentComplete = p.MacroPercentComplete;
progressDlg.MacroStatusText = p.MacroStatusText;
}
}
19
Source : BuilderForm.cs
with BSD 3-Clause "New" or "Revised" License
from DannyTheSloth
with BSD 3-Clause "New" or "Revised" License
from DannyTheSloth
private void btnBuild_Click(object sender, EventArgs e)
{
if (txtDNS.Text == null || txtPort.Text == null || txtName.Text == null || txtClientTag.Text == null ||
txtInterval.Text == null)
{
MessageBox.Show("Error: One or more text fields is empty.", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);
return;
}
Builder ClientBuilder = new Builder();
try
{
Convert.ToInt16(txtPort.Text);
Convert.ToInt16(txtInterval.Text);
}
catch (Exception EX)
{
MessageBox.Show("Error: " + EX.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
string Install = cbEnableInstallation.Checked ? "True" : "False";
string Startup = cbEnableStartup.Checked ? "True" : "False";
ClientBuilder.BuildClient(txtPort.Text, txtDNS.Text, txtName.Text, txtClientTag.Text, txtInterval.Text,
Install, Startup);
Process.Start("explorer.exe", Environment.CurrentDirectory + @"\Clients\");
Hide();
}
19
Source : InitialForm.cs
with BSD 3-Clause "New" or "Revised" License
from DannyTheSloth
with BSD 3-Clause "New" or "Revised" License
from DannyTheSloth
private void OnLoad(object sender, EventArgs e)
{
BeginInvoke(new MethodInvoker(delegate { Hide(); }));
}
19
Source : SetupForm.cs
with MIT License
from dariowouters
with MIT License
from dariowouters
private void NextBtn_Click(object sender, EventArgs e)
{
Cursor = Cursors.WaitCursor;
new TsMapCanvas(this, GameFolderBrowserDialog.SelectedPath, _mods).Show();
Hide();
}
19
Source : UIScreen.cs
with GNU General Public License v3.0
from DarwinBaker
with GNU General Public License v3.0
from DarwinBaker
public void Hide() => this.Form.Hide();
19
Source : FNetworkSetup.cs
with GNU General Public License v3.0
from DarwinBaker
with GNU General Public License v3.0
from DarwinBaker
private void Navigate(int offset)
{
this.pages[this.index].Hide();
this.index += offset;
this.pages[this.index].Show();
this.replacedle.Text = this.pages[this.index].Tag.ToString();
this.next.Enabled = false;
this.autoServerIP.Checked = true;
if (this.server.Checked)
this.autoServerIP.Show();
else
this.autoServerIP.Hide();
this.ip.UseSystemPreplacedwordChar = true;
this.toggleIP.Text = "Show IP Address";
this.UpdateControls();
}
19
Source : FNetworkSetup.cs
with GNU General Public License v3.0
from DarwinBaker
with GNU General Public License v3.0
from DarwinBaker
private void InitializePages()
{
this.pages = new Control[] {
this.page0,
this.page1,
this.page2,
this.page3
};
foreach (Control page in this.pages)
{
page.Location = this.page0.Location;
page.Hide();
}
this.Navigate(0);
}
19
Source : FormLoad.cs
with MIT License
from dathlin
with MIT License
from dathlin
private void button2_Click( object sender, EventArgs e )
{
Hide( );
using(FormLedDisplay form = new FormLedDisplay( ))
{
form.ShowDialog( );
}
System.Threading.Thread.Sleep( 200 );
Show( );
}
19
Source : FormLoad.cs
with MIT License
from dathlin
with MIT License
from dathlin
private void button4_Click( object sender, EventArgs e )
{
Hide( );
using (FormClock form = new FormClock( ))
{
form.ShowDialog( );
}
System.Threading.Thread.Sleep( 200 );
Show( );
}
19
Source : FormLoad.cs
with MIT License
from dathlin
with MIT License
from dathlin
private void button5_Click( object sender, EventArgs e )
{
Hide( );
using (FormCurve form = new FormCurve( ))
{
form.ShowDialog( );
}
System.Threading.Thread.Sleep( 200 );
Show( );
}
See More Examples