who is more powerfull? VB6 or VB.net 2010?

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • 4

54 Replies - 33208 Views - Last Post: 09 May 2012 - 12:00 PM

#31 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2271
  • View blog
  • Posts: 9,499
  • Joined: 29-May 08

Re: who is more powerfull? VB6 or VB.net 2010?

Posted 15 March 2012 - 01:55 PM

Why convert it?
The power of the .net framework is write in C# and "compile" it.
Then import a reference to it in a VB.net project.
Was This Post Helpful? 0
  • +
  • -

#32 Cambalinho  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 95
  • Joined: 04-March 12

Re: who is more powerfull? VB6 or VB.net 2010?

Posted 15 March 2012 - 01:57 PM

View PostAdamSpeight2008, on 15 March 2012 - 01:55 PM, said:

Why convert it?
The power of the .net framework is write in C# and "compile" it.
Then import a reference to it in a VB.net project.

sorry what you mean by that?
Was This Post Helpful? 0
  • +
  • -

#33 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2271
  • View blog
  • Posts: 9,499
  • Joined: 29-May 08

Re: who is more powerfull? VB6 or VB.net 2010?

Posted 15 March 2012 - 02:05 PM

Why even bother to convert it?
vb.net and C# speak the same intermediate language called MSIL.

So you can write components in different source programming languages and utilize them in another, provided they speak .net.
Was This Post Helpful? 0
  • +
  • -

#34 Cambalinho  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 95
  • Joined: 04-March 12

Re: who is more powerfull? VB6 or VB.net 2010?

Posted 15 March 2012 - 02:08 PM

View PostAdamSpeight2008, on 15 March 2012 - 02:05 PM, said:

Why even bother to convert it?
vb.net and C# speak the same intermediate language called MSIL.

So you can write components in different source programming languages and utilize them in another, provided they speak .net.

but i don't know use C#, i know(not very) C language. but it's a little diferent.
that's why i wanted convert that code
Was This Post Helpful? 0
  • +
  • -

#35 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2271
  • View blog
  • Posts: 9,499
  • Joined: 29-May 08

Re: who is more powerfull? VB6 or VB.net 2010?

Posted 15 March 2012 - 02:22 PM

Having trouble convert it you say, then first consult the available reference documentation. Primarily MSDN.

To learn what the C# symbols mean.
Then have a look in the vb.net reference documentation

Learning both isn't that hard.

Learn VB.net Video Tutorials
Learn C# Video Tutorials
Was This Post Helpful? 0
  • +
  • -

#36 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,511
  • Joined: 16-March 11

Re: who is more powerfull? VB6 or VB.net 2010?

Posted 15 March 2012 - 02:42 PM

Stop being lazy, and actually try to help yourself by making an effort to learn. We can't do your work for you.
Was This Post Helpful? 0
  • +
  • -

#37 Cambalinho  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 95
  • Joined: 04-March 12

Re: who is more powerfull? VB6 or VB.net 2010?

Posted 15 March 2012 - 03:46 PM

View Posttrevster344, on 15 March 2012 - 02:42 PM, said:

Stop being lazy, and actually try to help yourself by making an effort to learn. We can't do your work for you.

heres the code translated;)
Public Class TransPanel
	Inherits Panel




	Private Wriggler As New Timer()



	Public Sub New()


		'

		' TODO: Add constructor logic here

		'



		Wriggler.Tick += New EventHandler(AddressOf TickHandler)

		Me.Wriggler.Interval = 500


		Me.Wriggler.Enabled = True
	End Sub



	Protected Sub TickHandler(sender As Object, e As EventArgs)


		Me.InvalidateEx()

	End Sub



	Protected Overrides ReadOnly Property CreateParams() As CreateParams


		Get


			Dim cp As CreateParams = MyBase.CreateParams

			cp.ExStyle = cp.ExStyle Or &H20
			'WS_EX_TRANSPARENT

			Return cp
		End Get
	End Property




	Protected Sub InvalidateEx()


		If Parent Is Nothing Then

			Return
		End If



		Dim rc As New Rectangle(Me.Location, Me.Size)

		Parent.Invalidate(rc, True)

	End Sub



	Protected Overrides Sub OnPaintBackground(pevent As PaintEventArgs)


		'do not allow the background to be painted 

	End Sub



	Private r As New Random()



	Protected Overrides Sub OnPaint(e As PaintEventArgs)


		Dim h As Integer = Me.Height / 2

		Dim w As Integer = Me.Width / 2



		Dim p As New Pen(Color.Black, 2)

		Dim x As Integer, y As Integer

		x = 0
		y = 0
		While x < w



			e.Graphics.DrawEllipse(p, x + r.[Next](10) - 5, y + r.[Next](10) - 5, Me.Width - (2 * x), Me.Height - (2 * y))
			x += w \ 10
			y += h \ 10
		End While



		p.Dispose()

	End Sub





End Class

in time, i can share the control
Was This Post Helpful? 0
  • +
  • -

#38 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,511
  • Joined: 16-March 11

Re: who is more powerfull? VB6 or VB.net 2010?

Posted 15 March 2012 - 04:51 PM

Public Class TransPanel
	Inherits Panel




	Private WithEvents Wriggler As New Timer()



	Public Sub New()


		'

		' TODO: Add constructor logic here

		'


        '

        ' TODO: Add constructor logic here

        '



        AddHandler Wriggler.Tick, AddressOf TickHandler

        Me.Wriggler.Interval = 500


        Me.Wriggler.Enabled = True

	End Sub



	Protected Sub TickHandler(sender As Object, e As EventArgs)


		Me.InvalidateEx()

	End Sub



	Protected Overrides ReadOnly Property CreateParams() As CreateParams


		Get


			Dim cp As CreateParams = MyBase.CreateParams

			cp.ExStyle = cp.ExStyle Or &H20
			'WS_EX_TRANSPARENT

			Return cp
		End Get
	End Property




	Protected Sub InvalidateEx()


		If Parent Is Nothing Then

			Return
		End If



		Dim rc As New Rectangle(Me.Location, Me.Size)

		Parent.Invalidate(rc, True)

	End Sub



	Protected Overrides Sub OnPaintBackground(pevent As PaintEventArgs)


		'do not allow the background to be painted 

	End Sub



	Private r As New Random()



	Protected Overrides Sub OnPaint(e As PaintEventArgs)


		Dim h As Integer = Me.Height / 2

		Dim w As Integer = Me.Width / 2



		Dim p As New Pen(Color.Black, 2)

		Dim x As Integer, y As Integer

		x = 0
		y = 0
		While x < w



			e.Graphics.DrawEllipse(p, x + r.[Next](10) - 5, y + r.[Next](10) - 5, Me.Width - (2 * x), Me.Height - (2 * y))
			x += w \ 10
			y += h \ 10
		End While



		p.Dispose()

	End Sub





End Class



This one will work. ;)

This post has been edited by trevster344: 15 March 2012 - 04:52 PM

Was This Post Helpful? 0
  • +
  • -

#39 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2271
  • View blog
  • Posts: 9,499
  • Joined: 29-May 08

Re: who is more powerfull? VB6 or VB.net 2010?

Posted 15 March 2012 - 04:58 PM

Are you sure you need all of the whitespace?
Was This Post Helpful? 1
  • +
  • -

#40 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,511
  • Joined: 16-March 11

Re: who is more powerfull? VB6 or VB.net 2010?

Posted 15 March 2012 - 05:04 PM

Personally I still say drawing everything is easier, more efficient, and takes less code.
Was This Post Helpful? 0
  • +
  • -

#41 EndLessMind  Icon User is offline

  • These are the droids you're looking for
  • member icon

Reputation: 194
  • View blog
  • Posts: 1,099
  • Joined: 13-March 09

Re: who is more powerfull? VB6 or VB.net 2010?

Posted 15 March 2012 - 08:02 PM

But, there is a way you ease solve all those problem :)
It's called WPF ;)
There you can customize everything on a totally new level, with xaml :)
Give it a try :)
Was This Post Helpful? 2
  • +
  • -

#42 Cambalinho  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 95
  • Joined: 04-March 12

Re: who is more powerfull? VB6 or VB.net 2010?

Posted 16 March 2012 - 12:44 PM

View PostAdamSpeight2008, on 15 March 2012 - 04:58 PM, said:

Are you sure you need all of the whitespace?

no.. the problem was Copy\Paste lol.
but now i can change the code for show the images correctly, and maybe these code can let me use the Opacy;)
thanks to everyone

View Posttrevster344, on 15 March 2012 - 05:04 PM, said:

Personally I still say drawing everything is easier, more efficient, and takes less code.

have you sure?;)
i think not... i did 1 game with my sprite control on VB6 and i have seen the diference. and trust me it's more faster\simple. that's true that can use more CPU, but is more easy to use and you can do a game on a minutes with very less code;)

This post has been edited by Cambalinho: 16 March 2012 - 12:45 PM

Was This Post Helpful? 0
  • +
  • -

#43 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,511
  • Joined: 16-March 11

Re: who is more powerfull? VB6 or VB.net 2010?

Posted 16 March 2012 - 01:35 PM

Maybe it's more lazy and easier to do but when you create large games of complexity you need efficiency not what's faster for you to program. Takes me less code at least but I like to believe I have a very firm grasp on the concept of object oriented programming so as not to take a very long time programming something.
Was This Post Helpful? 0
  • +
  • -

#44 Ryano121  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1363
  • View blog
  • Posts: 3,002
  • Joined: 30-January 11

Re: who is more powerfull? VB6 or VB.net 2010?

Posted 16 March 2012 - 03:48 PM

Just because you are creating a large game of complexity doesn't necessarily mean that you are that worried about efficiency. A lot of games out there are relatively complex but don't display a high level of graphical detail which is when you should be worried about efficiency.

You have to think about the aims of the project. If you are not worried about efficiency then you write the code to not think about efficiency (to an extent). On the other hand if you are worried about that then you would write the code a lot differently.

Just because he is not taking the most efficient route, doesn't mean that he is using bad OOP design. It's just as easy to paint everything, get all the speed benefits, but write crappy code that nobody can read.
Was This Post Helpful? 0
  • +
  • -

#45 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,511
  • Joined: 16-March 11

Re: who is more powerfull? VB6 or VB.net 2010?

Posted 16 March 2012 - 04:23 PM

You don't want variables you don't need. My point was toward inheriting the panel, that's memory eaten up. You could easily avoid that, especially if you're looking for an artistic look that flows smoothly. ;)


correct me if im wrong.

This post has been edited by trevster344: 16 March 2012 - 04:38 PM

Was This Post Helpful? 0
  • +
  • -

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • 4