I wrote a GUI Form in c#. When I executed the program, white color becomes transparent.
It's suppose to be like this:
But when I run, it's like that:
You can see that white color became black like the picture behind.
using System;
using System.Drawing;
namespace Taki_Client
{
partial class SignIn
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnMenu = new System.Windows.Forms.Button();
this.picSignIn = new System.Windows.Forms.PictureBox();
this.btnSubmit = new System.Windows.Forms.Button();
this.tbUsername = new System.Windows.Forms.TextBox();
this.tbPassword = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.picSignIn)).BeginInit();
this.SuspendLayout();
//
// btnMenu
//
this.btnMenu.BackgroundImage = global::Taki_Client.Properties.Resources.Menu_Button;
this.btnMenu.Location = new System.Drawing.Point(314, 476);
this.btnMenu.Name = "btnMenu";
this.btnMenu.Size = new System.Drawing.Size(157, 57);
this.btnMenu.TabIndex = 4;
this.btnMenu.UseVisualStyleBackColor = true;
this.btnMenu.MouseClick += new System.Windows.Forms.MouseEventHandler(this.btnExit_MouseClick);
//
// picSignIn
//
this.picSignIn.BackColor = System.Drawing.Color.Transparent;
this.picSignIn.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.picSignIn.ErrorImage = null;
this.picSignIn.Image = global::Taki_Client.Properties.Resources.SignIn;
this.picSignIn.ImageLocation = "";
this.picSignIn.Location = new System.Drawing.Point(272, 12);
this.picSignIn.Name = "picSignIn";
this.picSignIn.Size = new System.Drawing.Size(288, 161);
this.picSignIn.TabIndex = 0;
this.picSignIn.TabStop = false;
this.picSignIn.Click += new System.EventHandler(this.pictureBox1_Click);
//
// btnSubmit
//
this.btnSubmit.BackgroundImage = global::Taki_Client.Properties.Resources.Submit_Button;
this.btnSubmit.Location = new System.Drawing.Point(314, 347);
this.btnSubmit.Name = "btnSubmit";
this.btnSubmit.Size = new System.Drawing.Size(157, 57);
this.btnSubmit.TabIndex = 5;
this.btnSubmit.UseVisualStyleBackColor = true;
this.btnSubmit.MouseClick += new System.Windows.Forms.MouseEventHandler(this.btnSubmit_MouseClick);
//
// tbUsername
//
this.tbUsername.BackColor = System.Drawing.SystemColors.HotTrack;
this.tbUsername.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(177)));
this.tbUsername.ForeColor = System.Drawing.SystemColors.Menu;
this.tbUsername.Location = new System.Drawing.Point(314, 223);
this.tbUsername.Multiline = true;
this.tbUsername.Name = "tbUsername";
this.tbUsername.Size = new System.Drawing.Size(201, 44);
this.tbUsername.TabIndex = 6;
this.tbUsername.Text = "Username";
//
// tbPassword
//
this.tbPassword.BackColor = System.Drawing.SystemColors.HotTrack;
this.tbPassword.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(177)));
this.tbPassword.ForeColor = System.Drawing.SystemColors.Menu;
this.tbPassword.Location = new System.Drawing.Point(314, 284);
this.tbPassword.Multiline = true;
this.tbPassword.Name = "tbPassword";
this.tbPassword.Size = new System.Drawing.Size(201, 44);
this.tbPassword.TabIndex = 7;
this.tbPassword.Text = "Password";
//
// SignIn
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.ActiveCaption;
this.BackgroundImage = global::Taki_Client.Properties.Resources.Taki_main_screen;
this.ClientSize = new System.Drawing.Size(804, 611);
this.Controls.Add(this.tbPassword);
this.Controls.Add(this.tbUsername);
this.Controls.Add(this.btnSubmit);
this.Controls.Add(this.btnMenu);
this.Controls.Add(this.picSignIn);
this.Name = "SignIn";
this.Text = "Taki Client";
this.TransparencyKey = System.Drawing.Color.Transparent;
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.picSignIn)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.PictureBox picSignIn;
private System.Windows.Forms.Button btnMenu;
private System.Windows.Forms.Button btnSubmit;
private System.Windows.Forms.TextBox tbUsername;
private System.Windows.Forms.TextBox tbPassword;
}
}
By setting the TransparencyKey of the form, transparency is enabled. Default color for transparency is white.
Remove this line from the InitializeComponent () function
this.TransparencyKey = System.Drawing.Color.Transparent;
and the white on your form will no longer be transparent.
Related
I have a issue : I have a main form who plays music when loaded : and I made a function who plays a sound when a button is pressed : the next form is minimized and their content too (from config.cs to every form), it's supposed to be at fullscreen and I want to keep it fullscreen and not minimized when playing a sound.
Code :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Media;
using System.IO;
using System.Runtime.InteropServices;
namespace Poker
{
public partial class Main : Form
{
[DllImport("wmp.dll")]
static extern Int32 mciSendString(string command, StringBuilder buffer, int bufferSize, IntPtr hwndCallback);
//LoadForm lform = new LoadForm();
Config config = new Config();
Settings settings = new Settings();
public Main()
{
InitializeComponent();
}
public void Main_Load(object sender, EventArgs e)
{
FormBorderStyle = FormBorderStyle.None;
WindowState = FormWindowState.Maximized;
new System.Threading.Thread(() =>
{
try
{
player1.PlayLooping();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message,
"Impossible de jouer le morceau.",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}).Start();
}
private void btnJouer_Click_1(object sender, EventArgs e)
{
btnClick();
this.Hide();
config.Show();
}
Sound function :
void btnClick()
{
new System.Threading.Thread(() =>
{
try
{
var _bt = new System.Windows.Media.MediaPlayer();
_bt.Open(new System.Uri(Environment.CurrentDirectory + "\\sfx\\button.wav"));
_bt.Play();
}
catch(Exception xe)
{
MessageBox.Show(xe.Message,
"Impossible de jouer ce son.",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}).Start();
}
Main form code :
namespace Poker
{
partial class Main
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main));
this.titre = new System.Windows.Forms.TableLayoutPanel();
this.label1 = new System.Windows.Forms.Label();
this.btnQuitter = new System.Windows.Forms.Button();
this.btnJouer = new System.Windows.Forms.Button();
this.btnPara = new System.Windows.Forms.Button();
this.titre.SuspendLayout();
this.SuspendLayout();
//
// titre
//
this.titre.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.titre.AutoSize = true;
this.titre.BackColor = System.Drawing.Color.Transparent;
this.titre.ColumnCount = 1;
this.titre.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.titre.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.titre.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.titre.Controls.Add(this.label1, 0, 0);
this.titre.Location = new System.Drawing.Point(0, 0);
this.titre.Name = "titre";
this.titre.RowCount = 1;
this.titre.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.titre.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.titre.Size = new System.Drawing.Size(1920, 300);
this.titre.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Segoe UI Semibold", 36F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(3, 0);
this.label1.MinimumSize = new System.Drawing.Size(100, 100);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(225, 100);
this.label1.TabIndex = 0;
this.label1.Text = "Poker";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnQuitter
//
this.btnQuitter.BackColor = System.Drawing.Color.Transparent;
this.btnQuitter.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnQuitter.Font = new System.Drawing.Font("Segoe UI", 16F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnQuitter.ForeColor = System.Drawing.Color.White;
this.btnQuitter.Location = new System.Drawing.Point(258, 754);
this.btnQuitter.Name = "btnQuitter";
this.btnQuitter.Size = new System.Drawing.Size(1361, 95);
this.btnQuitter.TabIndex = 3;
this.btnQuitter.Text = "Quitter";
this.btnQuitter.UseVisualStyleBackColor = false;
this.btnQuitter.Click += new System.EventHandler(this.btnQuitter_Click);
//
// btnJouer
//
this.btnJouer.BackColor = System.Drawing.Color.Transparent;
this.btnJouer.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnJouer.Font = new System.Drawing.Font("Segoe UI", 16F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnJouer.ForeColor = System.Drawing.Color.White;
this.btnJouer.Location = new System.Drawing.Point(258, 489);
this.btnJouer.Name = "btnJouer";
this.btnJouer.Size = new System.Drawing.Size(1361, 95);
this.btnJouer.TabIndex = 4;
this.btnJouer.Text = "Jouer";
this.btnJouer.UseVisualStyleBackColor = false;
this.btnJouer.Click += new System.EventHandler(this.btnJouer_Click_1);
//
// btnPara
//
this.btnPara.BackColor = System.Drawing.Color.Transparent;
this.btnPara.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnPara.Font = new System.Drawing.Font("Segoe UI", 16F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnPara.ForeColor = System.Drawing.Color.White;
this.btnPara.Location = new System.Drawing.Point(258, 621);
this.btnPara.Name = "btnPara";
this.btnPara.Size = new System.Drawing.Size(1361, 95);
this.btnPara.TabIndex = 5;
this.btnPara.Text = "Paramètres";
this.btnPara.UseVisualStyleBackColor = false;
this.btnPara.Click += new System.EventHandler(this.btnPara_Click);
//
// Main
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.ClientSize = new System.Drawing.Size(1920, 1046);
this.Controls.Add(this.btnPara);
this.Controls.Add(this.btnJouer);
this.Controls.Add(this.btnQuitter);
this.Controls.Add(this.titre);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "Main";
this.Text = "Poker";
this.Load += new System.EventHandler(this.Main_Load);
this.titre.ResumeLayout(false);
this.titre.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TableLayoutPanel titre;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnQuitter;
private System.Windows.Forms.Button btnJouer;
private System.Windows.Forms.Button btnPara;
}
}
Target form : (config.cs)
namespace Poker
{
partial class Config
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(525, 270);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(113, 65);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Config
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Config";
this.Text = "Configuration";
this.Load += new System.EventHandler(this.Config_Load);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button button1;
}
}
The problem is you creating a new thread, and the Program process switches to the second thread.
How to solve: Create one object of MediaPlayer, and switch a song, when you need.
Or: Create two separated MediaPlayers and pause one when you need.
Whereas MSDN suggests that some incompatible behavior might also cause this issue
In my case, The incompatible behavior is caused by some possibly weird(messed up mappings) on Entity Framework.
I have done due diligence to ensure one-to-one correspondence between the data model and the EF model(even recreated it twice, ground up)
The project builds and runs when I comment out a certain section of code.
public partial class TestForm : SecureForm
{
private myEntities _db = new myEntities();
public TestForm()
{
InitializeComponent();
PopulateTestsList();
}
private void PopulateTestsList()
{
listViewTypes.Items.Clear();
var query = from q in _db.Types orderby q.TypeName select q;
foreach (Type dt in query)
{
ListViewItem lvi = new ListViewItem(new string[]
{
dt.TypeName
});
lvi.Tag = dt;
listViewTypes.Items.Add(lvi);
}
}
private void buttonAdd_Click(object sender, EventArgs e)
{
TestEditForm myEditForm = new TestEditForm(_db);
if (myEditForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
PopulateTestsList();
}
private void buttonEdit_Click(object sender, EventArgs e)
{
if (listViewTypes.SelectedItems.Count > 0)
{
Test tsdt = listViewTypes.SelectedItems[0].Tag as Test;
if (myEditForm != null)
{
TestEditForm myEditForm = new TestEditForm(_db, mysForm);
if (myEditForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
PopulateTestsList();
}
}
}
}
It still does not show up the designer.
Here's the designer.cs for reference
partial class TestForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.buttonDelete = new System.Windows.Forms.Button();
this.buttonEdit = new System.Windows.Forms.Button();
this.buttonAdd = new System.Windows.Forms.Button();
this.listViewTypes = new System.Windows.Forms.ListView();
this.columnName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// buttonDelete
//
this.buttonDelete.Location = new System.Drawing.Point(304, 86);
this.buttonDelete.Name = "buttonDelete";
this.buttonDelete.Size = new System.Drawing.Size(75, 23);
this.buttonDelete.TabIndex = 9;
this.buttonDelete.Text = "Delete";
this.buttonDelete.UseVisualStyleBackColor = true;
this.buttonDelete.Click += new System.EventHandler(this.buttonDelete_Click);
//
// buttonEdit
//
this.buttonEdit.Location = new System.Drawing.Point(304, 56);
this.buttonEdit.Name = "buttonEdit";
this.buttonEdit.Size = new System.Drawing.Size(75, 23);
this.buttonEdit.TabIndex = 8;
this.buttonEdit.Text = "Edit";
this.buttonEdit.UseVisualStyleBackColor = true;
this.buttonEdit.Click += new System.EventHandler(this.buttonEdit_Click);
//
// buttonAdd
//
this.buttonAdd.Location = new System.Drawing.Point(304, 26);
this.buttonAdd.Name = "buttonAdd";
this.buttonAdd.Size = new System.Drawing.Size(75, 23);
this.buttonAdd.TabIndex = 7;
this.buttonAdd.Text = "Add";
this.buttonAdd.UseVisualStyleBackColor = true;
this.buttonAdd.Click += new System.EventHandler(this.buttonAdd_Click);
//
// listViewTypes
//
this.listViewTypes.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnName});
this.listViewTypes.FullRowSelect = true;
this.listViewTypes.HideSelection = false;
this.listViewTypes.Location = new System.Drawing.Point(12, 26);
this.listViewTypes.Name = "listViewTypes";
this.listViewTypes.Size = new System.Drawing.Size(274, 205);
this.listViewTypes.TabIndex = 6;
this.listViewTypes.UseCompatibleStateImageBehavior = false;
this.listViewTypes.View = System.Windows.Forms.View.Details;
//
// columnName
//
this.columnName.Text = "Document Type";
this.columnName.Width = 270;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 10);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(79, 13);
this.label1.TabIndex = 5;
this.label1.Text = "Test Standards";
//
// TestsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(395, 242);
this.Controls.Add(this.buttonDelete);
this.Controls.Add(this.buttonEdit);
this.Controls.Add(this.buttonAdd);
this.Controls.Add(this.listViewTypes);
this.Controls.Add(this.label1);
this.Name = "TestsForm";
this.Opacity = 1D;
this.Text = "Test Standards";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonDelete;
private System.Windows.Forms.Button buttonEdit;
private System.Windows.Forms.Button buttonAdd;
private System.Windows.Forms.ListView listViewTypes;
private System.Windows.Forms.ColumnHeader columnName;
private System.Windows.Forms.Label label1;
}
Code analysis shows that the form is missing,(MSBuild does not). MSBUILD compiles the form into an exe thats kinda defunct(on the broken entity)
The entity in question has Name & ID properties. Both Name and ID are mapped properly, The collection is pluralized and loaded into a list.
How to identify the broken entity and/or
How to Identify the non-compatible behavior in the code
I've created a form that I call a ListChooser. It looks like so:
It consists of a System.Windows.Forms.Button and .TextBox.
Clicking on the Button (shown above with the text "Fruits") causes a dialog to popup and some selections are made and the TextBox is populated, like so:
My problem is I can't figure out how to set a System.Windows.Forms.Binding to this TextBox. I think the complication is that it's not just a TextBox, it's 2 components in one. (I know how to data bind with just a standalone TextBox). If I go to the TextBox > Properties > DataBindings > Advanced > ..., All entries listed under Property are not selectable:
I've tried this which has no effect:
private System.Windows.Forms.BindingSource myBindingSource;
this.myBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.myBindingSource.DataSource = typeof(Foods) // Fruits is a Property of Foods;
myListChooser.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.myBindingSource, "Fruits", true));
How do I do this?
ListChooser.Designer.cs:
partial class ListChooser: UserControl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.btnPopup = new System.Windows.Forms.Button();
this.textBox = new System.Windows.Forms.TextBox();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout();
//
// btnPopup
//
this.btnPopup.AutoSize = true;
this.btnPopup.Dock = System.Windows.Forms.DockStyle.Fill;
this.btnPopup.Location = new System.Drawing.Point(0, 0);
this.btnPopup.Margin = new System.Windows.Forms.Padding(0);
this.btnPopup.Name = "btnPopup";
this.btnPopup.Size = new System.Drawing.Size(75, 21);
this.btnPopup.TabIndex = 0;
this.btnPopup.Text = "Type";
this.btnPopup.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnPopup.UseVisualStyleBackColor = true;
this.btnPopup.Click += new System.EventHandler(this.btnPopup_Click);
//
// txtList
//
this.textBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox.BackColor = System.Drawing.SystemColors.Window;
this.textBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBox.Location = new System.Drawing.Point(0, 0);
this.textBox.Name = "txtList";
this.textBox.ReadOnly = true;
this.textBox.Size = new System.Drawing.Size(297, 20);
this.textBox.TabIndex = 1;
this.textBox.TabStop = false;
this.textBox.TextChanged += new System.EventHandler(this.txtList_TextChanged);
//this.textBox.Leave += new System.EventHandler(this.txtList_Leave);
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Margin = new System.Windows.Forms.Padding(0);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.btnPopup);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.textBox);
this.splitContainer1.Size = new System.Drawing.Size(375, 21);
this.splitContainer1.SplitterDistance = 75;
this.splitContainer1.SplitterWidth = 3;
this.splitContainer1.TabIndex = 2;
//
// ListChooser
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.WhiteSmoke;
this.Controls.Add(this.splitContainer1);
this.MaximumSize = new System.Drawing.Size(1200, 21);
this.Name = "ListChooser";
this.Size = new System.Drawing.Size(375, 21);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btnPopup;
private System.Windows.Forms.TextBoxBase textBox;
private SplitContainer splitContainer1;
}
I have created a Form in c# windows. My form contains a button and a text box and it 's name is textbox2 here and it contains code like this in Form1.Designer.cs :
this.textBox2.Location = new System.Drawing.Point(683, 14);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(100, 20);
this.textBox2.TabIndex = 22;
Now i have created another class called Programss.cs which will do some task and as the task finished i want to print on my form something like this:
textBox2.txt= "Task finished"; //it should print on the textbox of my Form1.cs
How to access this textBox2(which can only be accessed currently in Form1.Designer.cs) in Programss.cs and my other classes ?
EDIT: After Philip Stuyck's comments:
Here is my Form1.cs code :
namespace S
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
//please see here
public string TextMessage
{
get { return textBox3.Text; }
set { textBox3.Text = value; }
}
private void btnStart_Click(object sender, EventArgs e)
{
btnStart.Enabled = false;
// StartServer();
}
private void btnClose_Click(object sender, EventArgs e)
{
}
}
}
And Program.cs is :
namespace Senter code here
{
class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
/////////////////////////////////////////////////////////////////////////////////////
// OtherImportantClasses.Programs prgms = new OtherImportantClasses.Programs();
Form1 theForm = new Form1();
theForm.TextMessage = "Task finished";
}
}
}
Form1.Designer.cs is:
namespace Shekhar
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
public void InitializeComponent()
{
this.btnClose = new System.Windows.Forms.Button();
this.btnStart = new System.Windows.Forms.Button();
this.txtPort = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// btnClose
//
this.btnClose.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnClose.Location = new System.Drawing.Point(313, 11);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(75, 23);
this.btnClose.TabIndex = 21;
this.btnClose.Text = "Close";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// btnStart
//
this.btnStart.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnStart.Location = new System.Drawing.Point(227, 12);
this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(75, 23);
this.btnStart.TabIndex = 20;
this.btnStart.Text = "Start";
this.btnStart.UseVisualStyleBackColor = true;
this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
//
// txtPort
//
this.txtPort.Location = new System.Drawing.Point(140, 12);
this.txtPort.Name = "txtPort";
this.txtPort.Size = new System.Drawing.Size(79, 20);
this.txtPort.TabIndex = 19;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(78, 12);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(55, 18);
this.label1.TabIndex = 18;
this.label1.Text = "Port : ";
OtherImportantClasses.Programs prog = new OtherImportantClasses.Programs();
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(400, 20);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(276, 18);
this.label2.TabIndex = 18;
this.label2.Text = "Total Number of device connected :";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(683, 14);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(100, 20);
this.textBox2.TabIndex = 22;
// this.textBox2.Text = "testbox2";
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(81, 60);
this.textBox3.Multiline = true;
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(702, 243);
this.textBox3.TabIndex = 23;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(818, 315);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.label2);
this.Controls.Add(this.btnClose);
this.Controls.Add(this.btnStart);
this.Controls.Add(this.txtPort);
this.Controls.Add(this.label1);
this.Name = "Form1";
this.Text = "Shekhar\'s GT06";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
/*
public string TextMessage
{
get
{
return textBox2.Text;
}
set
{
textBox2.Text = value;
}
}
*/
#endregion
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnStart;
private System.Windows.Forms.TextBox txtPort;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
}
}
Form1.Designer.cs is :
namespace S`enter code here`
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
public void InitializeComponent()
{
this.btnClose = new System.Windows.Forms.Button();
this.btnStart = new System.Windows.Forms.Button();
this.txtPort = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// btnClose
//
this.btnClose.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnClose.Location = new System.Drawing.Point(313, 11);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(75, 23);
this.btnClose.TabIndex = 21;
this.btnClose.Text = "Close";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// btnStart
//
this.btnStart.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnStart.Location = new System.Drawing.Point(227, 12);
this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(75, 23);
this.btnStart.TabIndex = 20;
this.btnStart.Text = "Start";
this.btnStart.UseVisualStyleBackColor = true;
this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
//
// txtPort
//
this.txtPort.Location = new System.Drawing.Point(140, 12);
this.txtPort.Name = "txtPort";
this.txtPort.Size = new System.Drawing.Size(79, 20);
this.txtPort.TabIndex = 19;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(78, 12);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(55, 18);
this.label1.TabIndex = 18;
this.label1.Text = "Port : ";
OtherImportantClasses.Programs prog = new OtherImportantClasses.Programs();
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(400, 20);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(276, 18);
this.label2.TabIndex = 18;
this.label2.Text = "Total Number of device connected :";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(683, 14);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(100, 20);
this.textBox2.TabIndex = 22;
// this.textBox2.Text = "testbox2";
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(81, 60);
this.textBox3.Multiline = true;
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(702, 243);
this.textBox3.TabIndex = 23;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(818, 315);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.label2);
this.Controls.Add(this.btnClose);
this.Controls.Add(this.btnStart);
this.Controls.Add(this.txtPort);
this.Controls.Add(this.label1);
this.Name = "Form1";
this.Text = "Shekhar\'s GT06";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
/*
public string TextMessage
{
get
{
return textBox2.Text;
}
set
{
textBox2.Text = value;
}
}
*/
#endregion
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Button btnStart;
private System.Windows.Forms.TextBox txtPort;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
}
}
It dont give any error but it do not print anything in textBox3 .
NOTE: Please note that first i run the winform code i click a button and when i click the button some proccess will run which will further print the text in the textbox. (I feel like my textmessage is not intialized by my message passed to it).
Make sure that textBox2 is public.(can be done in the designer)
Keep a reference to Form1 when you create it and access textBox2 via that reference.
Form1 theForm = new Form1();
... //do stuff
theForm.textBox2.Text = "Task finished";
This is not the most elegant approach to this, but it should work.
An alternative is like this :
public partial class Form1{
public string TextMessage{
get{
return textBox2.Text;
}
set{
textBox2.Text = value;
}
}
}
and in program.cs
Form1 theForm = new Form1();
... //do stuff
theForm.TextMessage = "Task finished";
your code will not work because
Form1 theForm = new Form1();
theForm.TextMessage = "Task finished";
is never executed.
Application.Run(new Form1());
returns only when the form is closed and then the application will end.
Following will work:
Form1 theForm = new Form1();
theForm.TextMessage = "Task finished";
Application.Run(theForm);
But I have the feeling you don't quite understand the framework.
Application.run, will make your application enter into a message loop which makes the application receive window messages.
One way you could do this is to have a method accessible in your Form1 that sets the textBox name to whatever you want. For instance:
public static void SetText (string message)
{
TextBox2.Text = message;
}
You would then call this from your Program.cs class:
Form1.SetText("Whatever text you want the text on the Form1 - TextBox2 to say");
This is the poor man's way of changing the text. There is a more detailed explanation on this other post if you need more details.
As I understood you want to print end result on textBox2.txt textbox, right? So you want to execute some methods on Programss.cs and once execution is finished you want to show "Task finished" on textBox2.txt.
If I am not wrong, what you have to do is return a value from a method from Programss.cs class. You have to call this method from Form1.Designer.cs class. Based on return value you can do whatever you want.
Hope this will be helpful.
You are creating two separate forms, setting text on the second, and expecting it to appear on the first.
Do this:
Form1 theForm = new Form1();
theForm.TextMessage = "Task finished";
Application.Run(theForm);
Newbie question. I downloaded the source of a project written in C#. There is an error occurring in one of the designer files used for constructing the GUI. Source attached below:
namespace Neurotec.Samples
{
partial class MainForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPageEnrollFromFile = new System.Windows.Forms.TabPage();
this.enrollFromFilePanel = new Neurotec.Samples.EnrollFromFile();
this.tabPageEnrollFromMicrophone = new System.Windows.Forms.TabPage();
this.enrollFromMicrophonePanel = new Neurotec.Samples.EnrollFromMicrophone();
this.tabPageVerify = new System.Windows.Forms.TabPage();
this.verifyVoicePanel = new Neurotec.Samples.VerifyVoice();
this.tabPageIdentify = new System.Windows.Forms.TabPage();
this.identifyVoicePanel = new Neurotec.Samples.IdentifyVoice();
this.tabControl1.SuspendLayout();
this.tabPageEnrollFromFile.SuspendLayout();
this.tabPageEnrollFromMicrophone.SuspendLayout();
this.tabPageVerify.SuspendLayout();
this.tabPageIdentify.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPageEnrollFromFile);
this.tabControl1.Controls.Add(this.tabPageEnrollFromMicrophone);
this.tabControl1.Controls.Add(this.tabPageVerify);
this.tabControl1.Controls.Add(this.tabPageIdentify);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(551, 398);
this.tabControl1.TabIndex = 0;
this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.TabControlSelectedIndexChanged);
//
// enrollFromFilePanel
//
this.enrollFromFilePanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.enrollFromFilePanel.Location = new System.Drawing.Point(3, 3);
this.enrollFromFilePanel.Name = "enrollFromFilePanel";
this.enrollFromFilePanel.Size = new System.Drawing.Size(540, 316);
this.enrollFromFilePanel.TabIndex = 0;
//
// tabPageEnrollFromFile
//
this.tabPageEnrollFromFile.Controls.Add(this.enrollFromFilePanel);
this.tabPageEnrollFromFile.Location = new System.Drawing.Point(4, 22);
this.tabPageEnrollFromFile.Name = "tabPageEnrollFromFile";
this.tabPageEnrollFromFile.Padding = new System.Windows.Forms.Padding(3);
this.tabPageEnrollFromFile.Size = new System.Drawing.Size(546, 322);
this.tabPageEnrollFromFile.TabIndex = 0;
this.tabPageEnrollFromFile.Text = "Enroll From File";
this.tabPageEnrollFromFile.UseVisualStyleBackColor = true;
//
// tabPageEnrollFromMicrophone
//
this.tabPageEnrollFromMicrophone.Controls.Add(this.enrollFromMicrophonePanel);
this.tabPageEnrollFromMicrophone.Location = new System.Drawing.Point(4, 22);
this.tabPageEnrollFromMicrophone.Name = "tabPageEnrollFromMicrophone";
this.tabPageEnrollFromMicrophone.Padding = new System.Windows.Forms.Padding(3);
this.tabPageEnrollFromMicrophone.Size = new System.Drawing.Size(546, 322);
this.tabPageEnrollFromMicrophone.TabIndex = 1;
this.tabPageEnrollFromMicrophone.Text = "Enroll From Microphone";
this.tabPageEnrollFromMicrophone.UseVisualStyleBackColor = true;
//
// enrollFromMicrophonePanel
//
this.enrollFromMicrophonePanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.enrollFromMicrophonePanel.Location = new System.Drawing.Point(3, 3);
this.enrollFromMicrophonePanel.Name = "enrollFromMicrophonePanel";
this.enrollFromMicrophonePanel.Size = new System.Drawing.Size(540, 316);
this.enrollFromMicrophonePanel.TabIndex = 0;
//
// tabPageVerify
//
this.tabPageVerify.Controls.Add(this.verifyVoicePanel);
this.tabPageVerify.Location = new System.Drawing.Point(4, 22);
this.tabPageVerify.Name = "tabPageVerify";
this.tabPageVerify.Size = new System.Drawing.Size(546, 322);
this.tabPageVerify.TabIndex = 2;
this.tabPageVerify.Text = "Verify Voice";
this.tabPageVerify.UseVisualStyleBackColor = true;
//
// verifyVoicePanel
//
this.verifyVoicePanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.verifyVoicePanel.Location = new System.Drawing.Point(0, 0);
this.verifyVoicePanel.Name = "verifyVoicePanel";
this.verifyVoicePanel.Size = new System.Drawing.Size(546, 322);
this.verifyVoicePanel.TabIndex = 0;
//
// tabPageIdentify
//
this.tabPageIdentify.Controls.Add(this.identifyVoicePanel);
this.tabPageIdentify.Location = new System.Drawing.Point(4, 22);
this.tabPageIdentify.Name = "tabPageIdentify";
this.tabPageIdentify.Size = new System.Drawing.Size(543, 372);
this.tabPageIdentify.TabIndex = 3;
this.tabPageIdentify.Text = "Identify Voice";
this.tabPageIdentify.UseVisualStyleBackColor = true;
//
// identifyVoicePanel
//
this.identifyVoicePanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.identifyVoicePanel.Location = new System.Drawing.Point(0, 0);
this.identifyVoicePanel.Name = "identifyVoicePanel";
this.identifyVoicePanel.Size = new System.Drawing.Size(543, 372);
this.identifyVoicePanel.TabIndex = 0;
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(551, 398);
this.Controls.Add(this.tabControl1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "MainForm";
this.Text = "Simple Voices Sample";
this.Load += new System.EventHandler(this.MainFormLoad);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainFormFormClosing);
this.tabControl1.ResumeLayout(false);
this.tabPageEnrollFromFile.ResumeLayout(false);
this.tabPageEnrollFromMicrophone.ResumeLayout(false);
this.tabPageVerify.ResumeLayout(false);
this.tabPageIdentify.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPageEnrollFromFile;
private System.Windows.Forms.TabPage tabPageEnrollFromMicrophone;
private System.Windows.Forms.TabPage tabPageVerify;
private System.Windows.Forms.TabPage tabPageIdentify;
private EnrollFromFile enrollFromFilePanel;
private EnrollFromMicrophone enrollFromMicrophonePanel;
private VerifyVoice verifyVoicePanel;
private IdentifyVoice identifyVoicePanel;
}
}
The errors state that some variables were undeclared or unassigned. As an example, the variable "enrollFromFilePanel" is said to be undeclared but it was created with the line "private EnrollFromFile enrollFromFilePanel;". I am sorry that I cannot provide an sscce and I hope that the solution is something simple. Thank you.