|
|
 |
| 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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

June 9th, 2008, 06:02 PM
|
|
Authorized User
|
|
Join Date: Jun 2008
Location: , , .
Posts: 33
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
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.
|

June 9th, 2008, 06:15 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,323
Thanks: 3
Thanked 70 Times in 69 Posts
|
|
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.
|

June 10th, 2008, 11:47 AM
|
|
Authorized User
|
|
Join Date: Jun 2008
Location: , , .
Posts: 33
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
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?
|

June 10th, 2008, 02:46 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,323
Thanks: 3
Thanked 70 Times in 69 Posts
|
|
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.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |