Click here to Skip to main content
11,584,612 members (67,855 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET VB.NET
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
asnaed307
Edited 2-Dec-12 11:43am
Nelek71.1K
v3
Comments
ProgramFOX at 1-Dec-12 12:17pm
   
What do you mean exactly?
Krunal Rohit at 2-Dec-12 0:55am
   
Whats your question ?? Its not a question...

1 solution

Rate this: bad
good
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.
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 430
1 Sergey Alexandrovich Kryukov 367
2 Dave Kreskowiak 260
3 Richard Deeming 220
4 virusstorm 194
0 OriginalGriff 1,703
1 Sergey Alexandrovich Kryukov 1,267
2 Abhinav S 711
3 Dave Kreskowiak 687
4 Suvendu Shekhar Giri 568


Advertise | Privacy | Mobile
Web04 | 2.8.150707.1 | Last Updated 2 Dec 2012
Copyright © CodeProject, 1999-2015
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