TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abhimanyu singh
NA
2
0
how to generate multiple form under a running thread ..
Apr 1 2009 1:19 AM
HELLO in my project i want to create new runtime form every time user clicks on button1.i have to open form under a running thread.....this is my code.. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Threading; using System.Net; using System.Net.Sockets; using System.IO; namespace testthread { public partial class Form1 : Form { IPEndPoint receivept; delegate void settextcallback(string text); public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { Thread t = new Thread(new ThreadStart(test)); t.IsBackground.CompareTo(true); t.Start(); CheckForIllegalCrossThreadCalls = false; } private void button1_Click(object sender, EventArgs e) { UdpClient send = new UdpClient(); IPEndPoint sendpt = new IPEndPoint(IPAddress.Parse("192.168.0.4"), 1080); byte[] data = System.Text.Encoding.UTF8.GetBytes("hello"); send.Send(data, data.Length, sendpt); send.Close(); } public void test() { UdpClient receive = new UdpClient(1080); do { try { byte[] data = receive.Receive(ref receivept); string text = System.Text.Encoding.UTF8.GetString(data); if (text.Contains("hello")) { data d = new data(); d.open("abhi"); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } while (true); } class data { public data() { } public void open(string text) { Form f = new Form(); f.Show(); Application.Run(f); } } } } Thanks..
Reply
Answers (
0
)
dataset doesnt get filled up {How do i fix this stored procedure}
pdf file not being created