|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Peculiar inconsistency in autogenerated event handler codeStart a new Windows Forms project. Double click Form1. This is what is generated: Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Experiment B: Start a new Windows Forms project. Go to the code window for Form1. Choose 'Form 1 events' from the left combo, then choose 'Load' from the right combo. This is what is generated: Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Note that in A, sender is 'System.Object', whereas in B it is 'Object'. Weird, huh? -- Larry Lard Replies to group please
Show quote
Hide quote
"Larry Lard" <larryl***@hotmail.com> schrieb: Yep. Unfortunately automatically generated code is rather inconsistent in > Experiment A: > Start a new Windows Forms project. Double click Form1. This is what is > generated: > > Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles MyBase.Load > > End Sub > > Experiment B: > Start a new Windows Forms project. Go to the code window for Form1. > Choose 'Form 1 events' from the left combo, then choose 'Load' from the > right combo. This is what is generated: > > Private Sub Form1_Load(ByVal sender As Object, ByVal e As > System.EventArgs) Handles MyBase.Load > > End Sub > > Note that in A, sender is 'System.Object', whereas in B it is 'Object'. > Weird, huh? its look. You may want to file a suggestion or bug report in MSDN Product Feedback Center (<URL:http://lab.msdn.microsoft.com/productfeedback/>) and post the URL to the report for voting here. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Looks like Microsoft didn't use good "encapsulation" practices even in their
own code. Sounds like two different (internal) functions are generating the stub... when there's no reason it should be one. CMM,
> Looks like Microsoft didn't use good "encapsulation" practices even in Withouth knowing what it is about.> their own code. Sounds like two different (internal) functions are > generating the stub... when there's no reason it should be one. > It is not Microsoft who does things like this, it are just developers like you. Keep that in mind when you write things like this. They don't do that express, in the same way as you don't do that. Cor > They don't do that express, in the same way as you don't do that. You mean they didn't do it on purpose? Well, likely not. I was just trying to "conceive" why this very minor but curious bug occurs. That's all. But, hey if it works it works right? Isn't that your motto? (screw standards, consistency, needless superflous encapsulation, and all that burdonsome stuff... 300 "" emptystrings in your code vs 1 String.Empty??? Eh, what does it matter? You like the way "" looks, right?). Years from now if a bug occurs someone else will figure out the code in the same exact way they can figure out your English sentences, right? (i.e. that sentence up there you wrote in NO WAY AT ALL makes any sense in English.) > It is not Microsoft who does things like this, it are just developers like Are you trying to offend me? Just because you need to use use hungarian > you. notation and I don't (anymore)? :-) Anywayz... CMM,
Not all of that, I try to protect those Microsoft developers. It can be that they made a mistake, that is not hilarious, what I did read a little bit in your message. I would only write it in that way, as it is sure that it is an official behaviour of Microsoft. Cor
ADO.net + MS Access = performance issues
EXE vs DLL Creation Draw backs of Serialized Objects Best Practices with In Memory Data Method description thingy... Device Driver in VB 2005 Converting a project from 2003 to 2005 differences Books On VB.NET 2005 Copying files across network String vs. Stringbuilder speed parsing questio |
|||||||||||||||||||||||