sara.solati68486 wrote:
Please advise if you know the answer. Otherwise, do not respond.
Dear Sara!
This is rude! People responded to your post without answering your question simply because you post a lot of invalid questions (including this one). You post your questions without proper preparations, posting not enough information, not investigating the problem using Debugger. No wonder some would try to help you to fix these problems and
really help you, but you apparently don't want to listen. Who would like to help you if you don't want to listen the advice.
Also, answering the question is not the best way to help you. Let's look at your code sample.
First of all, you did not indicate what click event do you mean. The method
Class11_Click
is not an event, but the naming suggests you use it as an event handler of some object. Your code does not show where you add the event handler. Most likely, this is done in your auto-generated code. I do not have any proof that the method
Class11_Click
was used to add to an invocation list of any event; the only evidence is your words about "half the real value", which suggests the click sometimes calls your method. But it can be some other method or whatever. Inaccurate way of posing your problems makes me suspect everything, including malfunction of your mouse. You did not explain a click on what do you do, because…
sara.solati68486 wrote:
If you run the program and click on the dll Object
is gibberish (
http://en.wikipedia.org/wiki/Gibberish[
^])!
You need to put a breakpoint on all your event handles and see what's going on using the Debugger. I cannot see a problem based just on the code you show. It could be somewhere else.
Some problems: you repeat some code, such as the line assigning to
Me.Text
. This is the invitation for all kind of bugs. No fragment of code should be repeated, ever. Can you create methods, without Designer? :-)
Do Not Repeat Yourself! See
http://en.wikipedia.org/wiki/Do_not_repeat_yourself[
^].
Did you know that you should not use string concatenation '&' repeatedly? Strings are
immutable, so this is a ridiculous performance problem. (Do I have to explain why?) Use
string.Format
instead, which is more readable and free from this performance problem. Also, you could comb the format itself: your repeated blank spaces don't help you at all.
Finally: your names fail to follow Microsoft naming conventions. Actually, most of the auto-generated names fail, but the fact they are generated by Microsoft Designer does not assume you should keep them. You need to give everything a semantic name. VS refactoring is a great help here, so it's not a labor to do so. At least, do it before posting a sample code.
—SA