vb6 - Converting VB 6 code to VB.NET -


i upgrading code vb 6 vb.net, , following code gives me error:

(vb6.pixelstotwipsx(mvarpicture.clientrectangle.width) - (bdr + x),  vb6.pixelstotwipsy(mvarpicture.clientrectangle.height) - (bdr + x)), mvarbordercolor, b 

the error is:

error 6 end of statement expected.

can me that?


this full code:

public sub draw()     dim bdr, x short     dim newx, newy double     dim oldx, oldy double     dim gridheight, gridwidth double     dim mvarpicturebox system.windows.forms.picturebox        on error goto nopicbox ' in case picbox isn't set yet      'upgrade_issue: picturebox property mvarpicturebox.autoredraw not upgraded. click more: 'ms-help://ms.vscc.v90/dv_commoner/local/redirect.htm?keyword="cc4c7ec0-c903-48fc-accc-81861d12da4a"'     if mvarpicture.autoredraw = false mvarpicture.autoredraw = true     'upgrade_issue: picturebox method mvarpicturebox.cls not upgraded. click more: 'ms-help://ms.vscc.v90/dv_commoner/local/redirect.htm?keyword="cc4c7ec0-c903-48fc-accc-81861d12da4a"'     mvarpicture.cls()      bdr = mvarpicturebox.borderstyle     'upgrade_issue: picturebox property mvarpicturebox.scalemode not upgraded. click more: 'ms-help://ms.vscc.v90/dv_commoner/local/redirect.htm?keyword="cc4c7ec0-c903-48fc-accc-81861d12da4a"'     if mvarpicture.scalemode <> 3 mvarpicture.scalemode = 3     if system.drawing.colortranslator.toole(mvarpicturebox.backcolor) <> system.drawing.colortranslator.toole(mvarpicbackground) mvarpicturebox.backcolor = mvarpicbackground     if mvarbordersize > 0         x = 0 mvarbordersize             'upgrade_issue: picturebox method mvarpicturebox.line not upgraded. click more: 'ms-help://ms.vscc.v90/dv_commoner/local/redirect.htm?keyword="cc4c7ec0-c903-48fc-accc-81861d12da4a"'             mvarpicture.line (x, x) - (vb6.pixelstotwipsx(mvarpicture.clientrectangle.width) - (bdr + x), vb6.pixelstotwipsy(mvarpicture.clientrectangle.height) - (bdr + x)), mvarbordercolor, b         next x     end if      ' display grid on screen     if mvargridvisible = true         x = 1 20             'upgrade_issue: picturebox method mvarpicturebox.line not upgraded. click more: 'ms-help://ms.vscc.v90/dv_commoner/local/redirect.htm?keyword="cc4c7ec0-c903-48fc-accc-81861d12da4a"'             mvarpicture.line (mvarbordersize, mvarbordersize) - ((((vb6.pixelstotwipsx(mvarpicturebox.clientrectangle.width) - (mvarbordersize * 2)) / 20) * x), (vb6.pixelstotwipsy(mvarpicturebox.clientrectangle.height) - (mvarbordersize * 2))), mvargridcolor, b         next x         x = 1 10             'upgrade_issue: picturebox method mvarpicturebox.line not upgraded. click more: 'ms-help://ms.vscc.v90/dv_commoner/local/redirect.htm?keyword="cc4c7ec0-c903-48fc-accc-81861d12da4a"'             mvarpicture.line (mvarbordersize, mvarbordersize) - ((vb6.pixelstotwipsx(mvarpicturebox.clientrectangle.width) - (mvarbordersize * 2)), (((vb6.pixelstotwipsy(mvarpicturebox.clientrectangle.height) - (mvarbordersize * 2)) / 10) * x)), mvargridcolor, b         next x     end if      if mvardatacollection.count() > 0         gridheight = ((vb6.pixelstotwipsy(mvarpicturebox.clientrectangle.height) - (mvarbordersize * 2)) / 100) + 0 ' 0-100%         gridwidth = ((vb6.pixelstotwipsx(mvarpicturebox.clientrectangle.width) - (mvarbordersize * 2)) / 100) + 0 ' 1-100 items                     if mvardatacollection.count() > 100 mvardatacollection.remove(1)         loop while mvardatacollection.count() > 100          oldx = mvarbordersize + 2         'upgrade_warning: couldn't resolve default property of object mvardatacollection(). click more: 'ms-help://ms.vscc.v90/dv_commoner/local/redirect.htm?keyword="6a50421d-15fe-4896-8a1b-2ec21e9037b2"'         oldy = ((vb6.pixelstotwipsy(mvarpicturebox.clientrectangle.height) - (mvarbordersize * 2)) - (mvardatacollection.item(1) * gridheight))         x = 1 100             newx = (vb6.pixelstotwipsx(mvarpicturebox.clientrectangle.width) - (mvarbordersize * 2)) - ((100 - (x - 1)) * gridwidth)             'upgrade_warning: couldn't resolve default property of object mvardatacollection(). click more: 'ms-help://ms.vscc.v90/dv_commoner/local/redirect.htm?keyword="6a50421d-15fe-4896-8a1b-2ec21e9037b2"'             newy = ((vb6.pixelstotwipsy(mvarpicturebox.clientrectangle.height) - (mvarbordersize * 2)) - (mvardatacollection.item(x) * gridheight))             newx = newx + 2             if newx < mvarbordersize newx = mvarbordersize             if newy < mvarbordersize newy = mvarbordersize              'upgrade_issue: picturebox method mvarpicturebox.line not upgraded. click more: 'ms-help://ms.vscc.v90/dv_commoner/local/redirect.htm?keyword="cc4c7ec0-c903-48fc-accc-81861d12da4a"'             mvarpicture.line (oldx, oldy) - (newx, newy), mvarpicforeground               oldx = newx : oldy = newy             if oldx < mvarbordersize oldx = mvarbordersize             if oldy < mvarbordersize oldy = mvarbordersize         next x     end if  nopicbox: end sub 

short answer, you're missing opening , closing parentheses on lines.

long answer, picturebox.line() not supported in vb.net. check out http://msdn.microsoft.com/en-us/library/9dtfzwyx(v=vs.90).aspx , http://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawline(v=vs.90).aspx how in .net.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -