[visual basic] Lolwut?

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
User avatar
driesguldolf
Extreme Poster
Posts: 395
Joined: Thu 17 May, 2007 4:49 pm
Location: $4080
Contact:

[visual basic] Lolwut?

Post by driesguldolf »

I was experimenting a bit and then this happend:
Image
And I was like "lolwut?"

So how is this possible? (I'm not an expert in visualbasic, learning C++ now)
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Quite simply; the ImageFormat class has static properties that return new instances of the class set to a particular ImageFormat type.

If you have an instance of ImageFormat, you can then (via Visual Studio's debugger) access the ImageFormat's static members to retrieve another instance of the ImageFormat, then use that new instance to retrieve another one, and so on and so forth...

Edit: C#'s debugger makes it more obvious that you're accessing static members - screenshot.
User avatar
driesguldolf
Extreme Poster
Posts: 395
Joined: Thu 17 May, 2007 4:49 pm
Location: $4080
Contact:

Post by driesguldolf »

Ah ok, thanks for the info!
(I knew it was somewhere very normal)
Post Reply