Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2008 > Visual Basic 2008 Essentials
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Visual Basic 2008 Essentials If you are new to Visual Basic programming with version 2008, this is the place to start your questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2008 Essentials section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 9th, 2008, 05:02 PM
Authorized User
 
Join Date: Jun 2008
Location: , , .
Posts: 33
Thanks: 2
Thanked 0 Times in 0 Posts
Default How do I write this vb 6 code to work in vb 2008?

This is a peice of code from my vb6 program that wont upgrade to vb 2008. Below is the wording of the errors I get for this section. The Comment lines that say upgrade issue are from the wizard update for vb 2008. The links given don't seem to help me much.



Private Sub DrawWafer()

Dim i, j As Short

Dim Rad As Single

XSpan = Wafer.XPitch * Wafer.Cols

YSpan = Wafer.YPitch * Wafer.Rows

Rad = Wafer.WaferSize * 20

'UPGRADE_ISSUE: PictureBox method picDraw.Cls was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"'

picDraw.Cls()

'UPGRADE_ISSUE: PictureBox property picDraw.FillStyle was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"'

picDraw.FillStyle = 1

'UPGRADE_ISSUE: PictureBox method picDraw.Scale was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"'

picDraw.Scale (-100, Wafer.WaferSize * 40 + 100) - (Wafer.WaferSize * 40 + 100, -100)

'UPGRADE_ISSUE: PictureBox method picDraw.Circle was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"'

picDraw.Circle (Rad, Rad), Rad, System.Drawing.ColorTranslator.ToOle(System.Drawin g.Color.Black), (100 * PI / 180), (80 * PI / 180)

'UPGRADE_ISSUE: PictureBox method picDraw.Line was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"'

picDraw.Line (Rad + Rad * System.Math.Cos(80 * PI / 180), Rad + Rad * System.Math.Sin(80 * PI / 180)) - (Rad - Rad * System.Math.Cos(80 * PI / 180), Rad + Rad * System.Math.Sin(80 * PI / 180))

MarkSkips()

End Sub





The errors are as follows:

Error 42 'Cls' is not a member of 'System.Windows.Forms.Panel'.
Error 43 'FillStyle' is not a member of 'System.Windows.Forms.Panel'.
Error 44 End of statement expected.
Error 45 'Circle' is not a member of 'System.Windows.Forms.Panel'.
Error 46 End of statement expected.
Error 47 'Line' is not a member of 'System.Windows.Forms.Panel'.
Error 48 End of statement expected.
Reply With Quote
  #2 (permalink)  
Old June 9th, 2008, 05:15 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

The basic problem is that for some reason you (or the upgrader?) chose to convert your picDraw object to a Panel (as the error message says, specifically to an instance of System.Windows.Form.Panel).

That's clearly not the right conversion, as a Panel has no drawing capabilities, at all. It's just a container for other object, including various sorts of drawing objects.

So go find where/what picDraw was in your VB6 code and figure out what it should have been changed to for VB.NET.

I'd guess that *probably* it should be an instance of System.Drawing.Graphics. Probably.
Reply With Quote
  #3 (permalink)  
Old June 10th, 2008, 10:47 AM
Authorized User
 
Join Date: Jun 2008
Location: , , .
Posts: 33
Thanks: 2
Thanked 0 Times in 0 Posts
Default

The automatic wizard that comes up when you try to open a vb6 file in vb 2008 chose to convert the picDraw object to a panel. PicDraw is the name of a picturebox that lines and circles are created in. How do I change it from being a panel?

Reply With Quote
  #4 (permalink)  
Old June 10th, 2008, 01:46 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Can't help you. Never used the VB6 to VB.NET upgrade wizard.

Best I can suggest is some code editing by hand.

Maybe somebody who has done this can help.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why buy vs-2008 instead of vb-2008 jerryham VB.NET 7 September 2nd, 2008 02:39 PM
how write vb code in c# ravpaw General .NET 2 July 1st, 2007 02:13 PM
Dowloaded code (VB.NET 2003) does not work kadesskade VB.NET 2002/2003 Basics 2 July 10th, 2006 12:49 AM
VB starter kit - Rowfilter code doesn't work Bucephalus VB Databases Basics 0 May 26th, 2006 05:56 PM



All times are GMT -4. The time now is 10:08 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.