54 Replies - 15543 Views - Last Post: 09 May 2012 - 12:00 PM
#31
Re: who is more powerfull? VB6 or VB.net 2010?
Posted 15 March 2012 - 01:55 PM
The power of the .net framework is write in C# and "compile" it.
Then import a reference to it in a VB.net project.
#32
Re: who is more powerfull? VB6 or VB.net 2010?
Posted 15 March 2012 - 01:57 PM
#33
Re: who is more powerfull? VB6 or VB.net 2010?
Posted 15 March 2012 - 02:05 PM
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.
#34
Re: who is more powerfull? VB6 or VB.net 2010?
Posted 15 March 2012 - 02:08 PM
AdamSpeight2008, on 15 March 2012 - 02:05 PM, said:
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
#35
Re: who is more powerfull? VB6 or VB.net 2010?
Posted 15 March 2012 - 02:22 PM
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
#36
Re: who is more powerfull? VB6 or VB.net 2010?
Posted 15 March 2012 - 02:42 PM
#37
Re: who is more powerfull? VB6 or VB.net 2010?
Posted 15 March 2012 - 03:46 PM
trevster344, on 15 March 2012 - 02:42 PM, said:
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
#38
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
#39
Re: who is more powerfull? VB6 or VB.net 2010?
Posted 15 March 2012 - 04:58 PM
#40
Re: who is more powerfull? VB6 or VB.net 2010?
Posted 15 March 2012 - 05:04 PM
#41
Re: who is more powerfull? VB6 or VB.net 2010?
Posted 15 March 2012 - 08:02 PM
It's called WPF
There you can customize everything on a totally new level, with xaml
Give it a try
#42
Re: who is more powerfull? VB6 or VB.net 2010?
Posted 16 March 2012 - 12:44 PM
AdamSpeight2008, on 15 March 2012 - 04:58 PM, said:
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
trevster344, on 15 March 2012 - 05:04 PM, said:
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
#43
Re: who is more powerfull? VB6 or VB.net 2010?
Posted 16 March 2012 - 01:35 PM
#44
Re: who is more powerfull? VB6 or VB.net 2010?
Posted 16 March 2012 - 03:48 PM
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.
#45
Re: who is more powerfull? VB6 or VB.net 2010?
Posted 16 March 2012 - 04:23 PM
correct me if im wrong.
This post has been edited by trevster344: 16 March 2012 - 04:38 PM
|
|

New Topic/Question
Reply




MultiQuote




|