Click here to Skip to main content
15,880,796 members

Comments by DaveyM69 (Top 115 by date)

DaveyM69 28-Apr-16 8:20am View    
Reason for my vote of 4 \n With a little work to clean things up for my situation your code worked fine - thanks.
DaveyM69 23-Jan-14 5:00am View    
Reason for my vote of 5 \n Handy :)
DaveyM69 14-Jul-13 16:17pm View    
You are creating a new Form1 every time the Button is clicked in Form2. The OP hasn't stated whether this is what he needs, but normally the initial instance is required.
Additionally, these instances are only ever hidden and never closed - that's going to start using a lot of unnecessary memory very quickly!
DaveyM69 28-Feb-13 16:36pm View    
"If you don't use Dispose your code will be disposed at closing application time": or not. There can be occasions (especially but not exclusively when handling unmanaged resources with PInvoke etc) where it may not happen. Disposing of intensive or unmanaged resources in a timely manner is good coding practice - using 'using' makes this far more convenient and there is no excuse normally for not doing so.
DaveyM69 17-Feb-13 7:32am View    
The OP wants it the other way round, change Label's text in form 1 from form 2.
There are two ways to do this - constructor injection or an event. An event it the preferred and cleanest (most OOP) way. Refer to OriginalGriff's answer.