Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
QuestionMike`s Gradiator Pin
Alejandro01122-Mar-21 2:22
Alejandro01122-Mar-21 2:22 
AnswerRe: Mike`s Gradiator Pin
Richard Deeming22-Mar-21 2:41
mveRichard Deeming22-Mar-21 2:41 
GeneralRe: Mike`s Gradiator Pin
Alejandro01122-Mar-21 2:48
Alejandro01122-Mar-21 2:48 
AnswerRe: Mike`s Gradiator Pin
Gerry Schmitz22-Mar-21 7:49
mveGerry Schmitz22-Mar-21 7:49 
GeneralRe: Mike`s Gradiator Pin
Alejandro01122-Mar-21 10:16
Alejandro01122-Mar-21 10:16 
GeneralRe: Mike`s Gradiator Pin
Alejandro01123-Mar-21 14:53
Alejandro01123-Mar-21 14:53 
QuestionHow to write to Form1.texBox1 from another class. Pin
Member 1406872419-Mar-21 11:17
Member 1406872419-Mar-21 11:17 
AnswerRe: How to write to Form1.texBox1 from another class. Pin
OriginalGriff19-Mar-21 12:24
mveOriginalGriff19-Mar-21 12:24 
You can't.
The Tick event happens asynchronously, but occurs on the same thread as the original code - so if your code starts a timer and then does a long running operation while loading you still won't see anything. The only way to get round that is to move the long running operation to a second thread (see the BackgroundWorker class[^] and report progress to the main thread to update the display.

And your code won't work, because your Nonameclass creates a new instance of the Form1 class which is never displayed. To display anything you would need to access the actual instance that created the Nonameclass instance and that means passing the Form1 instance to the constructor. Which is a bad idea, because it breaks OOPs and locks the two class designs together, as does exposing the TextBox publicly in your Form1 class!

You need to think about exactly what you are trying to achieve here, because the route you are trying to go is a bad idea. What you really want to do is probably possible, and even quite easy - but this way is not a good route to that (or anything else!)
"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!

QuestionCombobox Text Pin
Ismael Oliveira 202119-Mar-21 8:01
Ismael Oliveira 202119-Mar-21 8:01 
AnswerRe: Combobox Text Pin
OriginalGriff19-Mar-21 9:44
mveOriginalGriff19-Mar-21 9:44 
GeneralRe: Combobox Text Pin
Ismael Oliveira 202119-Mar-21 10:14
Ismael Oliveira 202119-Mar-21 10:14 
AnswerRe: Combobox Text Pin
BillWoodruff20-Mar-21 6:15
professionalBillWoodruff20-Mar-21 6:15 
QuestionUnhandle System.AccessViolationException from FFMediaToolkit Pin
huycaothu18-Mar-21 23:05
huycaothu18-Mar-21 23:05 
AnswerRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
OriginalGriff18-Mar-21 23:19
mveOriginalGriff18-Mar-21 23:19 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
huycaothu19-Mar-21 2:43
huycaothu19-Mar-21 2:43 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
OriginalGriff19-Mar-21 2:56
mveOriginalGriff19-Mar-21 2:56 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
huycaothu20-Mar-21 0:03
huycaothu20-Mar-21 0:03 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
Dave Kreskowiak19-Mar-21 4:28
mveDave Kreskowiak19-Mar-21 4:28 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
Richard MacCutchan19-Mar-21 4:38
mveRichard MacCutchan19-Mar-21 4:38 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
huycaothu19-Mar-21 23:53
huycaothu19-Mar-21 23:53 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
Richard MacCutchan20-Mar-21 0:10
mveRichard MacCutchan20-Mar-21 0:10 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
huycaothu20-Mar-21 0:52
huycaothu20-Mar-21 0:52 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
huycaothu20-Mar-21 1:00
huycaothu20-Mar-21 1:00 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
Richard MacCutchan20-Mar-21 3:04
mveRichard MacCutchan20-Mar-21 3:04 
GeneralRe: Unhandle System.AccessViolationException from FFMediaToolkit Pin
huycaothu21-Mar-21 15:51
huycaothu21-Mar-21 15:51 

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.