Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am currently converting an old VB6 game into NET version. THank God that the project converter worked for this one! Still, it didn't help much. I have tons of lines to debug and correct. Now, one variable or component that NET could not find was the "StdFont" from vb6. This was VB's old font component. can't seem to find the location of it in NET. Can anyone help me here?

-----------------------------------------------------------------

BTW - another question: how do I add or create references to public variables and objects from a class if I wanted to access them from a form?

  • *Experts*
Posted

It's System.Drawing.Font in .NET. Note that the architecture of .NET is totally different than VB6, so it is not the same exact Font class as VB6's.

 

To create public variables, but them in a class as being shared:

Class Declarations
 Public Shared publicVar As Integer
End Class

Then, from any form you can access it with 'Declarations.PublicVar'.

Posted

great, thanks. I tried the adding "shared" to the variables, that worked, but how come stand alone procedures don't show up when I try to call them from another object, let's say a form? They are all public, yet I can't access them!

 

Sorry, I am well experienced in VB but I just got VbNET!

Posted

Ohh wait!! I see now :)

 

:eek:

 

the variables within a public shared procedure must be declated shared as well. This is all coming clear now.... ah yes... I am now well-learnt in Vb.NET ... time to start programming with my new master skills!! :D

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...