|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
with...end with and the pictureboxwhy is it that using "with...end with" with the picturebox still requires you to follow this syntax With PictureBox .FillStyle = 1 .DrawWidth = 2 PictureBox.Circle (x, y), 500 PictureBox.Line (x, y) - (x + 100, y + 100) End With instead of With PictureBox .FillStyle = 1 .DrawWidth = 2 .Circle (x, y), 500 .Line (x, y) - (x + 100, y + 100) End With lance "Lance" <nu***@business.com> wrote in message Because .Circle and .Line aren't really methods exposed by the pictureboxnews:eRLsG2SYFHA.3572@TK2MSFTNGP12.phx.gbl > hi all, > > why is it that using "with...end with" with the picturebox still > requires you to follow this syntax > > With PictureBox > .FillStyle = 1 > .DrawWidth = 2 > PictureBox.Circle (x, y), 500 > PictureBox.Line (x, y) - (x + 100, y + 100) control's interface. The VB compiler is intercepting those statements and "pretending" that those methods existing by doing the appropriate graphics work for you. It would have been nice if that had been extended to the With handling but whether it's an oversight or a bug or just something they did not have time to do before release it's not there. That the compiler supports these "methods" at all is a testament to the time when the VB development team cared about people being able to move their code forward to new versions with minimal trouble. -- Reply to the group so all can participate VB.Net: "Fool me once..." ah, thanks.
lance Show quoteHide quote "Bob Butler" <tiredofit@nospam.com> wrote in message news:O%23urvBTYFHA.1412@TK2MSFTNGP12.phx.gbl... > "Lance" <nu***@business.com> wrote in message > news:eRLsG2SYFHA.3572@TK2MSFTNGP12.phx.gbl >> hi all, >> >> why is it that using "with...end with" with the picturebox still >> requires you to follow this syntax >> >> With PictureBox >> .FillStyle = 1 >> .DrawWidth = 2 >> PictureBox.Circle (x, y), 500 >> PictureBox.Line (x, y) - (x + 100, y + 100) > > Because .Circle and .Line aren't really methods exposed by the picturebox > control's interface. The VB compiler is intercepting those statements and > "pretending" that those methods existing by doing the appropriate graphics > work for you. It would have been nice if that had been extended to the With > handling but whether it's an oversight or a bug or just something they did > not have time to do before release it's not there. > > That the compiler supports these "methods" at all is a testament to the time > when the VB development team cared about people being able to move their > code forward to new versions with minimal trouble. > > -- > Reply to the group so all can participate > VB.Net: "Fool me once..." > |
|||||||||||||||||||||||