Click here to Skip to main content
13,046,337 members (111,300 online)
Rate this:
Please Sign up or sign in to vote.
See more:
My problem is that I want a function of the form that is called the put disabled that and not how
nesesito help

[Edit]Code block formatting removed - ProgramFox[/Edit]

OP's additional information moved from non-solution below - Nelek
I want to create a function that detects that form has been called the function.
the purpose is to make a message box style form that only personalized and to not be copying the same form that the function call to a single form and this form sierre which was called

idk if I explain well and sorry for not tap to miss anes
Posted 1-Dec-12 6:10am
Updated 2-Dec-12 11:43am
ProgramFOX 1-Dec-12 12:17pm
What do you mean exactly?
Krunal Rohit 2-Dec-12 0:55am
Whats your question ?? Its not a question...

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Your English doesn't make much sense, but I'll take a guess at what you mean.

If you think you need to do determine the name of the form that called your method, you have a serious design flaw.

First, doing so would couple your code directly to those forms, making it impossible to modify one without breaking the other and making it impossible to use the code in other applications or situations. For example, you're coding this method to find the name of the form class that called it, but what it you suddenly wanted to show the MessageBox from a non-Form class?? Now you're stuck...

Second, if you have functionality in that code that needs to change, based on form that called it, you're much better off putting that method code in the class for each form.

Now, in your code, you would not show the class name of the form to the user. If the MessageBox needs to show the name of a form, your form code could would normally call method that creates the MessageBox and pass in a user friendly name as a string.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 2 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100