Shoutbox

Visual Basic 6 or Visual Basic .NET? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Visual Basic 6 or Visual Basic .NET? (/showthread.php?tid=30419)

Visual Basic 6 or Visual Basic .NET? by DJeX on 08-25-2004 at 07:51 AM

I'm making a trojan detection program which will tell you whats connected to your computer, allows you to block IP's form connecting to your computer, Full netstats, and more. But since I really don't want to learn C++ I need a simple and effective code to make it in. Now I've started in VB 6 but I'm wondering if it would be worth while to move to VB. NET. Is VB.NET better? or should I stick with VB 6 for now?


RE: Visual Basic 6 or Visual Basic .NET? by Mnjul on 08-25-2004 at 10:31 AM

To be honest, VB .Net, based on .Net Framework, has better Windows integration, and more importantly, easy access to Windows core functions (I think you may need this a lot). For example, registry accessing requires quite a few API calls, and you need to take care of things more than just calling those functions. But in VB .Net, it's been wrapped as Classes and things are a lot easier.

Still there are some disadvantages indeed, for example:
1. VB 6 and VB .Net is very different (I bet, more different than most of you think) when it comes to system-related programming. Re-learn :p
2. If you prepare to distribute your program, your users have to have .net redistributable package installed - that is not a small file. Usually a user wouldn't want to download a file 20MB+ large, for a small tool. :)


RE: Visual Basic 6 or Visual Basic .NET? by spokes on 08-25-2004 at 03:34 PM

I'd personally use VB6 the run-times are smaller and most computers have them. As Mnjul said the .Net Framework is 20MB+ (23). VB.Net is better but some users may be limited


RE: Visual Basic 6 or Visual Basic .NET? by DJeX on 08-25-2004 at 04:32 PM

Thanks, I'll stick with VB untill I feel like learning C++ (Which won't be for awhile now) o and have any of you (Mnjul, or  spokes25) read my post on UserControls? Would you know how to access A UserControl's objects. Like for example:

UserControl4.TextBox1.Text = Form1.TextBox1.Text

OR

UserControl4.TextBox1.Text = UserControl2.Label1.Caption


Just a question, I need to know how for my program. Thats why I thought of swiching to .NET in hope it would help me with that. But I guess there has to be a way to do it in VB.


RE: Visual Basic 6 or Visual Basic .NET? by Mnjul on 08-25-2004 at 05:11 PM

I think you should add member functions to user controls, like this...

This is UserControl2's member function. Assume it has a Checkbox named Check1

Public Function GetCheck1Caption() As String
    GetCheck1 = Check1.Caption
End Function


And in Form code you just... (uc2Control is a UserControl2)

'blahblah...
    Whatever=uc2Control.GetCheck1Caption
'blahblah...



I know it's a little bit troublesome (even strange). Actually, if you use VB.Net, this can be easier with its full OOP support.


RE: Visual Basic 6 or Visual Basic .NET? by DJeX on 08-25-2004 at 05:37 PM

The only problem with that is it wont let you go from Control to Control only from Form to Control.


RE: Visual Basic 6 or Visual Basic .NET? by Mnjul on 08-25-2004 at 05:47 PM

Well...

Member function:
Public Sub SetCheck1Caption(NewCap As String)
    Check1.Caption = NewCap
End Sub

And then use something like this
uc1Blah.SetCheck1Caption uc2Blah.GetLabel1Caption()


RE: Visual Basic 6 or Visual Basic .NET? by DJeX on 08-26-2004 at 01:51 AM

Humm well,

This is what I can do with the code:
(From a usercontrol) Text1.text = Form1.text

This is what I can't do (and that I need to do):
UserControl3.Text5.text = Text4.text (From a Form)
(From Control to Control) (From a Control) Text1.text = UserControl3.Text4.text (To a Control)

Basicly I need it so I can change stuff in a Control from a form and to change stuff from a control in another control.

Thanks for all your help so far I hope you can tell me what I need. :)


RE: Visual Basic 6 or Visual Basic .NET? by Mnjul on 08-26-2004 at 02:46 AM

As I said, I think you should use member functions. Those child-controls have been wrapped and I don't think there's a way to access them directly. Are you sure that you want to use UserControls, instead of Forms with instances (Dim AForm as New frmFormTemplate)?


RE: Visual Basic 6 or Visual Basic .NET? by DJeX on 08-26-2004 at 05:09 AM

I'm sorry but I'm fairly new at VB, I know most things but not Instances or member functions. If you don't mind do you think you could explain a little more about those?

Thanks!

EDIT:
When I first started my program I needed somehting simple and quick to add into my main Form. So I used UserControls. Now I really dont want to add all my user controls to my main Form because of name conflicts. Like in UserControl1 I got Command1 and Text1 and so does my main Form. So I really don't want to rename all my objects and edit all my code to sute. That would be ALOT of work for me. Since i'm almost done this program I need a solution to fix this little problem I have got myself into. Any Sugestions.