[.net] Should be a simple C# question....

Started by
2 comments, last by Mulligan 19 years, 7 months ago
If i want an event to occur directly after when a dialog box appears for the first time, what event to I have to respond to? Also, how do I go about calling a managed C# dll function from a managed C# application? I have found zero resources on this topic, which seems very odd to me.... [Edited by - Mulligan on September 1, 2004 10:40:27 PM]
Advertisement
Well, for the first one, add a delegate to the Load event, and then have the delegate remove itself from the Load event.

For the second one: you add a reference to the dll to your application. From that point on you can reference to the classes in the dll. Don't forget about namespaces.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

Quote:If i want an event to occur directly after when a dialog box appears for the first time, what event to I have to respond to?

Don't think there is one, not that corresponds exactly to what you're after anyway. The Form.Activated event will be raised every time the form is activated (which will happen directly after it first appears, but that isn't the only time), or Form.Load will be raised before the first time the form is shown time.

Quote:Also, how do I go about calling a managed C# dll function from a managed C# application?

All you have to do is add a reference the DLL in your project, or on the command-line use the option /reference:somedll.dll. Then you just use whatever you want from the DLL, analogous to #including a .h file in C++ except that it's already compiled.
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V
cool, thanks.

This topic is closed to new replies.

Advertisement