Click here to Skip to main content
15,916,846 members
Home / Discussions / C#
   

C#

 
GeneralRe: How can I open a webpage in IE and fill in 1 or more text boxes in the page? Pin
Eddy Vluggen11-Feb-15 7:33
professionalEddy Vluggen11-Feb-15 7:33 
GeneralRe: How can I open a webpage in IE and fill in 1 or more text boxes in the page? Pin
turbosupramk311-Feb-15 7:42
turbosupramk311-Feb-15 7:42 
GeneralRe: How can I open a webpage in IE and fill in 1 or more text boxes in the page? Pin
Eddy Vluggen11-Feb-15 7:59
professionalEddy Vluggen11-Feb-15 7:59 
GeneralRe: How can I open a webpage in IE and fill in 1 or more text boxes in the page? Pin
turbosupramk311-Feb-15 8:25
turbosupramk311-Feb-15 8:25 
GeneralRe: How can I open a webpage in IE and fill in 1 or more text boxes in the page? Pin
turbosupramk311-Feb-15 8:58
turbosupramk311-Feb-15 8:58 
GeneralRe: How can I open a webpage in IE and fill in 1 or more text boxes in the page? Pin
Eddy Vluggen12-Feb-15 5:46
professionalEddy Vluggen12-Feb-15 5:46 
GeneralRe: How can I open a webpage in IE and fill in 1 or more text boxes in the page? Pin
turbosupramk312-Feb-15 8:51
turbosupramk312-Feb-15 8:51 
QuestionRe: How can I open a webpage in IE and fill in 1 or more text boxes in the page? Pin
Eddy Vluggen12-Feb-15 11:35
professionalEddy Vluggen12-Feb-15 11:35 
AnswerRe: How can I open a webpage in IE and fill in 1 or more text boxes in the page? Pin
turbosupramk313-Feb-15 1:55
turbosupramk313-Feb-15 1:55 
GeneralRe: How can I open a webpage in IE and fill in 1 or more text boxes in the page? Pin
turbosupramk313-Feb-15 2:04
turbosupramk313-Feb-15 2:04 
GeneralRe: How can I open a webpage in IE and fill in 1 or more text boxes in the page? Pin
Eddy Vluggen13-Feb-15 3:03
professionalEddy Vluggen13-Feb-15 3:03 
GeneralRe: How can I open a webpage in IE and fill in 1 or more text boxes in the page? Pin
turbosupramk313-Feb-15 3:27
turbosupramk313-Feb-15 3:27 
GeneralRe: How can I open a webpage in IE and fill in 1 or more text boxes in the page? Pin
Eddy Vluggen13-Feb-15 5:07
professionalEddy Vluggen13-Feb-15 5:07 
AnswerRe: How can I open a webpage in IE and fill in 1 or more text boxes in the page? Pin
Rahul Anand Jha14-Feb-15 5:17
Rahul Anand Jha14-Feb-15 5:17 
GeneralRe: How can I open a webpage in IE and fill in 1 or more text boxes in the page? Pin
turbosupramk314-Feb-15 8:35
turbosupramk314-Feb-15 8:35 
QuestionC# app.config modification/replacement on install Pin
Member 1133483710-Feb-15 19:43
Member 1133483710-Feb-15 19:43 
AnswerRe: C# app.config modification/replacement on install Pin
Pete O'Hanlon10-Feb-15 20:06
mvePete O'Hanlon10-Feb-15 20:06 
QuestionThreads and event handlers Pin
TMattC10-Feb-15 9:45
TMattC10-Feb-15 9:45 
I´m writing a communication library and have a threaded method listening for incoming data:
C#
///// Inside my library /////
public partial class MCSerialPort
{
   (SerialPort)port.DataReceived += DataReceivedHandler;

   // The event handler method
   private async void DataReceivedHandler(object sender, SerialDataReceivedEventArgs args)
   {
      await ReadData();
   }

   private async Task ReadData()
   {
      await Task.Run(() =>
      {
         ... // Reading incoming
         // Triggering an event
         PackageReceived(this, new PackageReceivedEventArgs(package));
      });
   }
}

///// Inside the "client" using the library /////
(MCSerialPort)port.PackageReceived += PackageReceivedHandler;

private void PackageReceivedHandler(object sender, PackageReceivedEventArgs args)
{
   Package p = args.Package;
   receivedRtb.Invoke((Action)delegate{receivedRtb.Text += p.ToString();} );
}

The thing is that when using this library in a "client" project the PackageReceived event handler method in the client (here the PackageReceivedHandler()) seems to be running on the same thread as the librarys ReadData() method, because I have to call Invoke() in this example in order to get the info into the receivedRtb RichTextBox. This complicates things slightly for the average library user, who might not think of having to write threadsafe code in the handler method. Is there any convenient way to make PackageReceivedHandler() run on the "main" thread?
AnswerRe: Threads and event handlers Pin
PIEBALDconsult10-Feb-15 10:21
mvePIEBALDconsult10-Feb-15 10:21 
AnswerRe: Threads and event handlers Pin
Richard Deeming10-Feb-15 10:30
mveRichard Deeming10-Feb-15 10:30 
Question[Solved] I'm trying to load random pictures in label tag controls when i load a form (windows forms) Pin
bunagee12310-Feb-15 7:14
bunagee12310-Feb-15 7:14 
AnswerRe: I'm trying to load random pictures in label tag controls when i load a form (windows forms) Pin
Eddy Vluggen10-Feb-15 7:53
professionalEddy Vluggen10-Feb-15 7:53 
GeneralRe: I'm trying to load random pictures in label tag controls when i load a form (windows forms) Pin
bunagee12310-Feb-15 9:22
bunagee12310-Feb-15 9:22 
GeneralRe: I'm trying to load random pictures in label tag controls when i load a form (windows forms) Pin
Eddy Vluggen10-Feb-15 11:12
professionalEddy Vluggen10-Feb-15 11:12 
GeneralRe: I'm trying to load random pictures in label tag controls when i load a form (windows forms) Pin
bunagee12311-Feb-15 1:39
bunagee12311-Feb-15 1:39 

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.