Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2008 > Visual Basic 2008 Essentials
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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.
  #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.
  #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?

  #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.


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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.