Click here to Skip to main content
15,920,508 members
Home / Discussions / C#
   

C#

 
AnswerRe: change the size of pages in rdlc report Pin
xxwwyy20-Jan-09 3:00
xxwwyy20-Jan-09 3:00 
Questionusing c header files Pin
lawrenceinba20-Jan-09 1:47
lawrenceinba20-Jan-09 1:47 
AnswerRe: using c header files Pin
musefan20-Jan-09 1:55
musefan20-Jan-09 1:55 
AnswerRe: using c header files Pin
Dave Kreskowiak20-Jan-09 2:01
mveDave Kreskowiak20-Jan-09 2:01 
AnswerRe: using c header files Pin
Christian Graus20-Jan-09 2:12
protectorChristian Graus20-Jan-09 2:12 
AnswerRe: using c header files Pin
#realJSOP20-Jan-09 2:26
professional#realJSOP20-Jan-09 2:26 
AnswerRe: using c header files Pin
PIEBALDconsult21-Jan-09 5:55
mvePIEBALDconsult21-Jan-09 5:55 
QuestionMoving value to textbox control from another thread Pin
The_Collector20-Jan-09 1:15
The_Collector20-Jan-09 1:15 
Good Day Everybody....
i've been trying to move a value to a textbox control from another thread... I tried so many things but it doesn't work. Anybody who can help me, i really need it badly. Thnx n advance to kind people who r ready to share thier knowledge.

below are my coding:

-------------------
form1.cs
------------------
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;

namespace webbrowser
{
public partial class WebBrowser : Form
{
public delegate void DisplayHandler(string stringMessage);
public event DisplayMessage;

public WebBrowser()
{
InitializeComponent();
}

private void WebBrowser_Load(object sender, EventArgs e)
{

Thread threadSocket = new Thread(new ThreadStart(StartSocket));
threadSocket.Start();
}

public static void StartSocket()
{
SocketServer mySocket = new SocketServer();
mySocket.SocketDataArrival += new SocketServer.SocketServerHandler(ShowDataArrival);
mySocket.InititateServer();
}

void DisplayMessage(string stringMessage)
{
TxtBoxMsg.Text = stringMessage;
}

static void ShowDataArrival(object a, SocketServerArgs e)
{
DisplayHandler d = new DisplayHandler();
d.Invoke(e.Message);
}

}
}

---------------------------
Class1.cs
-----------
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.IO;

namespace webbrowser
{
public class SocketServer
{

public delegate void SocketServerHandler(object myObject, SocketServerArgs myArgs);

public event SocketServerHandler SocketDataArrival;

public void InititateServer()
{
StreamWriter streamWriter;
StreamReader streamReader;
NetworkStream networkStream;
TcpListener tcpListener = new TcpListener(8000);
tcpListener.Start();
Socket serverSocket = tcpListener.AcceptSocket();
try
{
if (serverSocket.Connected)
{
networkStream = new NetworkStream(serverSocket);
streamWriter = new StreamWriter(networkStream);
streamReader = new StreamReader(networkStream);
SocketServerArgs myArgs = new SocketServerArgs(streamReader.ReadLine());
SocketDataArrival(this, myArgs);
}
}
catch (SocketException ex)
{
Console.WriteLine(ex);
}
}
public SocketServer()
{
}
}

public class SocketServerArgs : EventArgs
{
private string message;

public SocketServerArgs(string message)
{
this.message = message;
}

public string Message
{
get
{
return message;
}
}
}

}

xxx

AnswerRe: Moving value to textbox control from another thread Pin
J a a n s20-Jan-09 1:20
professionalJ a a n s20-Jan-09 1:20 
GeneralRe: Moving value to textbox control from another thread Pin
The_Collector20-Jan-09 2:55
The_Collector20-Jan-09 2:55 
AnswerRe: Moving value to textbox control from another thread Pin
musefan20-Jan-09 1:23
musefan20-Jan-09 1:23 
GeneralRe: Moving value to textbox control from another thread Pin
The_Collector20-Jan-09 2:50
The_Collector20-Jan-09 2:50 
AnswerRe: Moving value to textbox control from another thread Pin
Eddy Vluggen20-Jan-09 1:40
professionalEddy Vluggen20-Jan-09 1:40 
GeneralRe: Moving value to textbox control from another thread Pin
The_Collector20-Jan-09 2:57
The_Collector20-Jan-09 2:57 
GeneralRe: Moving value to textbox control from another thread Pin
Eddy Vluggen20-Jan-09 3:14
professionalEddy Vluggen20-Jan-09 3:14 
GeneralRe: Moving value to textbox control from another thread Pin
The_Collector20-Jan-09 3:24
The_Collector20-Jan-09 3:24 
GeneralRe: Moving value to textbox control from another thread Pin
The_Collector20-Jan-09 3:27
The_Collector20-Jan-09 3:27 
GeneralRe: Moving value to textbox control from another thread Pin
Eddy Vluggen20-Jan-09 3:37
professionalEddy Vluggen20-Jan-09 3:37 
GeneralRe: Moving value to textbox control from another thread Pin
The_Collector20-Jan-09 3:41
The_Collector20-Jan-09 3:41 
GeneralRe: Moving value to textbox control from another thread Pin
Eddy Vluggen20-Jan-09 6:52
professionalEddy Vluggen20-Jan-09 6:52 
GeneralRe: Moving value to textbox control from another thread Pin
The_Collector20-Jan-09 11:12
The_Collector20-Jan-09 11:12 
GeneralRe: Moving value to textbox control from another thread Pin
The_Collector20-Jan-09 11:55
The_Collector20-Jan-09 11:55 
GeneralRe: Moving value to textbox control from another thread Pin
Eddy Vluggen20-Jan-09 21:33
professionalEddy Vluggen20-Jan-09 21:33 
Questionmuting my current process Pin
sperlis20-Jan-09 0:54
sperlis20-Jan-09 0:54 
AnswerRe: muting my current process Pin
Dave Kreskowiak20-Jan-09 1:58
mveDave Kreskowiak20-Jan-09 1:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.