Form disappearing
Windows Forms
1
Posts
1
Posters
3
Views
1
Watching
-
Hi All Having some trouble trying to get a form to persist, rather than disappearing / not appearing when run. Probably something silly, command in the wrong location etc C#, Visual Studio. Code newbie, please be gentle.
using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Windows.Forms;namespace TCPReader
{public class frmConfiguration : System.Windows.Forms.Form { private void frmConfiguration\_Load(object sender, System.EventArgs e) { } private System.Windows.Forms.Button btnok; private System.Windows.Forms.Button button2; private System.ComponentModel.IContainer components; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; public USBReader.readerqueue m\_queue; public USBReader.Socketclient m\_sclient; public System.Threading.Thread thread1; public System.Threading.Thread threadClient; private System.Windows.Forms.TextBox txtipaddres; private System.Windows.Forms.TextBox txtportno; private void btnok\_Click(object sender, System.EventArgs e) { try { bool flag = txtipaddres.Text != "" && txtportno.Text != ""; if (!flag) { System.Windows.Forms.MessageBox.Show("Enter IP Address and Port No to Connet\\n to the Node", "Node Control", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Asterisk); Show(); } else { System.IO.TextWriter textWriter = System.IO.File.CreateText(System.Windows.Forms.Application.StartupPath + "\\\\IPAddress.txt"); textWriter.WriteLine(txtportno.Text + ";" + txtipaddres.Text); textWriter.Close(); DialogResult = System.Windows.Forms.DialogResult.OK; Close(); } } catch (System.Exception e1) { } } private void button2\_Click(object sender, System.EventArgs e) { DialogResult = System.Windows.Forms.DialogResult.Cancel; Close(); } private void Configurati