Click here to Skip to main content
15,884,298 members
Home / Discussions / C#
   

C#

 
GeneralRe: Securing a Named Pipe Pin
lmoelleb2-Jan-23 20:26
lmoelleb2-Jan-23 20:26 
QuestionHow to access a Form1() method from an external class library dll? Pin
Member 460215929-Dec-22 10:17
Member 460215929-Dec-22 10:17 
AnswerRe: How to access a Form1() method from an external class library dll? Pin
jschell29-Dec-22 11:56
jschell29-Dec-22 11:56 
GeneralRe: How to access a Form1() method from an external class library dll? Pin
Member 460215929-Dec-22 12:44
Member 460215929-Dec-22 12:44 
AnswerRe: How to access a Form1() method from an external class library dll? Pin
Dave Kreskowiak29-Dec-22 12:29
mveDave Kreskowiak29-Dec-22 12:29 
AnswerRe: How to access a Form1() method from an external class library dll? Pin
Gerry Schmitz29-Dec-22 16:46
mveGerry Schmitz29-Dec-22 16:46 
AnswerRe: How to access a Form1() method from an external class library dll? Pin
BillWoodruff29-Dec-22 19:13
professionalBillWoodruff29-Dec-22 19:13 
AnswerRe: How to access a Form1() method from an external class library dll? Pin
OriginalGriff29-Dec-22 20:42
mveOriginalGriff29-Dec-22 20:42 
Turn the problem on it's head, and ask yourself "does it happen in other code?"

And the answer is "yes": it happens all the time. When something happens in a class, it wants to tell the outside world about it.

When the user clicks a button, when data arrives at a serial port, when a timer expires - they all need to tell your code that it happened. They do this by means of Events which your code subscribes to and processes via a handler method.
The user clicks a button? The Button raises the Click event, your code handles it and checks the data he entered.
Data arrives? The SerialPort class raises the DataRecieved event, your code handles it and processes the characters.
The timer interval expires? The Timer class raises the Tick event, your code handles it and updates the on screen clock.

So why not use the same mechanism in your code? Your external class creates an Event, your form adds a Handler; your external class wants your form to do something, it raises the event, the handler method does the work.

Have a look here: Transferring information between two forms, Part 2: Child to Parent[^] - it's form / control based, but it's exactly the same process for "normal" classes.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

Questionneed to convert drawing demo into a chart control Pin
Southmountain28-Dec-22 2:55
Southmountain28-Dec-22 2:55 
AnswerRe: need to convert drawing demo into a chart control Pin
OriginalGriff28-Dec-22 4:09
mveOriginalGriff28-Dec-22 4:09 
GeneralRe: need to convert drawing demo into a chart control Pin
Southmountain28-Dec-22 19:08
Southmountain28-Dec-22 19:08 
GeneralRe: need to convert drawing demo into a chart control Pin
OriginalGriff28-Dec-22 19:27
mveOriginalGriff28-Dec-22 19:27 
QuestionHas anyone used CutePDF SDK with C# to prefill forms Pin
Member 1587725927-Dec-22 9:01
Member 1587725927-Dec-22 9:01 
AnswerRe: Has anyone used CutePDF SDK with C# to prefill forms Pin
OriginalGriff27-Dec-22 9:08
mveOriginalGriff27-Dec-22 9:08 
AnswerRe: Has anyone used CutePDF SDK with C# to prefill forms Pin
BillWoodruff27-Dec-22 18:37
professionalBillWoodruff27-Dec-22 18:37 
QuestionC# Thread Pin
Basel Shikh Osman26-Dec-22 0:11
Basel Shikh Osman26-Dec-22 0:11 
AnswerRe: C# Thread Pin
OriginalGriff26-Dec-22 1:02
mveOriginalGriff26-Dec-22 1:02 
GeneralRe: C# Thread Pin
Basel Shikh Osman26-Dec-22 1:06
Basel Shikh Osman26-Dec-22 1:06 
GeneralRe: C# Thread Pin
OriginalGriff26-Dec-22 1:14
mveOriginalGriff26-Dec-22 1:14 
GeneralRe: C# Thread Pin
BillWoodruff26-Dec-22 2:50
professionalBillWoodruff26-Dec-22 2:50 
AnswerRe: C# Thread Pin
Gerry Schmitz26-Dec-22 8:16
mveGerry Schmitz26-Dec-22 8:16 
QuestionUpdating properties in a IEnumerable Pin
hpjchobbes24-Dec-22 4:14
hpjchobbes24-Dec-22 4:14 
AnswerRe: Updating properties in a IEnumerable Pin
Gerry Schmitz24-Dec-22 6:35
mveGerry Schmitz24-Dec-22 6:35 
GeneralRe: Updating properties in a IEnumerable Pin
hpjchobbes24-Dec-22 9:58
hpjchobbes24-Dec-22 9:58 
GeneralRe: Updating properties in a IEnumerable Pin
Gerry Schmitz24-Dec-22 23:48
mveGerry Schmitz24-Dec-22 23:48 

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.