|
no need for delegates, if form 1 called form 2 and you have problems passing values from form 2 to form 1 just make accessor methods from form 2 that after form 2 is closed, you can get the values from form 2.. you can also make use of again accessor methods if you want to pass values from form 1 to form 2 that before showing form2, set first the values then show form 2
|
|
|
|
|
don´t use 2 forms, use 1 form and load userforms inside, like what i showed you before.
I would use many form, for exemple, if i wanted to create a chat application (to load private chat windows).
But ... you are the boss i don´t know what you are trying to achieve.
Good Luck
nelsonpaixao@yahoo.com.br
|
|
|
|
|
Hi there,
I would like find one or two open source projects that use test-driven development in good practices.
I will use them to understand how unit testing works in real world.
(The language can be Java or C#, does not matter so much.)
Any suggestion would be appreciated,
Regards,
sarp
|
|
|
|
|
NUnit, look at the tests for itself!
|
|
|
|
|
I want to see how test driven developed project goes and learn something from their experience via understand their code(open-source).
|
|
|
|
|
Hi all.
I've two picture box overlapping.In it I load .png file (with trasparent border).
But i can't see only the first PictureBox.
I've read a lot on internet but i haven't find a solution.
How can i enable the trasparency?
Thanks.
|
|
|
|
|
Try using a Panel instead to load the png file in. Set it's BackColor to to Color.Transparent . This should do it.
|
|
|
|
|
Or try using this wonderfull tutorial: http://www.codeproject.com/KB/GDI-plus/CsTranspTutorial3.aspx[^]
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_______________________________________________________________________________________
My programs never have bugs, they just develop random features.
_______________________________________________________________________________________
Computers are so strange, you just yawn good and proper and they've got something new out! R. A.
|
|
|
|
|
I've already try to set it as trasparent but it not work.
|
|
|
|
|
Hi, I'm developing a C# user control to be hosted in IE6. The user control needs to be able to reach out and grab values that are assigned to elements in the Web form that hosts the user control. The Web form is contained in a JSP (not ASP.NET) and uses javascript. Obviously the Web form has a reference to the user control, but how does the user control get a reference to the Web form (parent container) that hosts it so that the user control can read element values in the Web form? I know how to make the Web form pass values to the user control, but I don't know how to make the user control get values from the Web form. Any help would be appreciated.
|
|
|
|
|
You cannot host C# user controls in JSP pages. Period. Only ASP.NET can.
Chuck Norris has the greatest Poker-Face of all time. He won the 1983 World Series of Poker, despite holding only a Joker, a Get out of Jail Free Monopoloy card, a 2 of clubs, 7 of spades and a green #4 card from the game UNO. In the movie "The Matrix", Chuck Norris is the Matrix. If you pay close attention in the green "falling code" scenes, you can make out the faint texture of his beard. Chuck Norris actually owns IBM. It was an extremely hostile takeover.
|
|
|
|
|
Thanks, Dogcow Farmer.
I realized from your answer that I did not phrase my question well. I should have called it an ActiveX control. I developed it starting as a user control in VS but then added some interfaces that allow it to function as an ActiveX control (IObjectSafety, IPropertyNotifySink). I am not asking it to post back to the server; it is all client-side.
I found a page that suggests implementing IOleObject[^], but it doesn't explain how to implement this interface or how to get a reference to the container after the interface is implemented. The interface definition at MSDN[^] does not provide that information, either.
If anyone knows how to give a C# ActiveX control a reference to its containing browser, either using IOleObject or some other way, I would appreciate any help you can give me.
|
|
|
|
|
ActiveX is even worse. It's insecure, IE-only, and pretty much a living heck to work with. Besides, C# is near impossible to host in ActiveX.
Chuck Norris has the greatest Poker-Face of all time. He won the 1983 World Series of Poker, despite holding only a Joker, a Get out of Jail Free Monopoloy card, a 2 of clubs, 7 of spades and a green #4 card from the game UNO. In the movie "The Matrix", Chuck Norris is the Matrix. If you pay close attention in the green "falling code" scenes, you can make out the faint texture of his beard. Chuck Norris actually owns IBM. It was an extremely hostile takeover.
|
|
|
|
|
Hello
Im writing an application that will implement its own custom exceptions
Just wanted to hear if anyone has any input before I start on how to do this "best practise"??
Cheers
Spaz
|
|
|
|
|
Derive new classes from existing exceptions. Use ApplicationException as a base, not Exception.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Christian Graus wrote: Use ApplicationException as a base, not Exception.
Not really. From MSDN's Best Practices for Handling Exceptions[^]:
For most applications, derive custom exceptions from the Exception class. It was originally thought that custom exceptions should derive from the ApplicationException class; however in practice this has not been found to add significant value.
/ravi
|
|
|
|
|
Hi,
I am working through the Singleton pattern from www.dofactory.com, and I am not understanding the code at the bottom. I do not understand why they check twice for instance == null, please can some one help explain:
private static object syncLock = new object();
if (instance == null)
{
lock (syncLock)
{
if (instance == null)
{
instance = new LoadBalancer();
}
}
}
Actually I don't understand anything ob the above mentioned code..
Thanks
Brendan
|
|
|
|
|
.NET Enthusiast wrote: I do not understand why they check twice for instance == null
That's called Double checked locking[^].
|
|
|
|
|
Thanks I will check out that link..
|
|
|
|
|
|
Ah yes. The double lock check - which is unnecessary in C#. This same code can be accomplished using the static keyword:
public sealed class LoadBalancer()
{
private static readonly LoadBalancer _instance = new LoadBalancer();
private LoadBalancer() {}
public static LoadBalancer Instance
{
get { return _instance ; }
}
} The key here is that the CLR initializes the _instance member the first time this class is used. As you can see, this code is significantly simpler, and it solves the same problem in a different fashion - plus it's slightly more efficient.
|
|
|
|
|
This holds for single threaded applications only.
|
|
|
|
|
Assume you want to allow only one instance of the LoadBalancer class. The usual Singleton Pattern assures exactly that, except that it holds for single threaded applications only.
Assume you have more than one threads (e.g. A and B), both working with LoadBalancer. Then it could happen that, while thread A is just creating an instance of the LoadBalancer, the thread scheduler decides thread B to run which also wants to create an instance of LoadBalancer. This results in two instances of the LoadBalancer to be created. That's why you have to lock the instanciation so that only one thread at a time can create the instance.
|
|
|
|
|
what is the difference between Compile Time Polymorphism & Run Time Polymorphism ?
|
|
|
|
|
See here.[^]
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|