Click here to Skip to main content
15,883,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have learnt the basics and am able to draw various kinds of things on forms with persistent graphics and colour them. Now I would like to learn more but cannot find good tutorials. Do you know of such free tutorials on the Internet?

I still do not understand classes and methods well (my background being in QBasic and VB3 and VB6). I do not understand the parameters that are passed in control event handling routines at all - sender, e, EventArgs, PaintEventArgs, etc. Please suggest what to read up or which tutorials to go through. Drawing on forms from subroutines in modules is also creating troubles often.

What I have tried:

I have gone through a few basic tutorials and they seem mostly trivial to me now. I understand the concept of classes and methods and properties to some extent but am not familiar with them to create my own classes, namespaces and user controls. I have a project of 5 forms with graphics which is working fine but the code is very inefficient.
Posted
Updated 7-Aug-21 22:23pm

Quote:
I still do not understand classes and methods well (my background being in QBasic and VB3 and VB6). I do not understand the parameters that are passed in control event handling routines at all - sender, e, EventArgs, PaintEventArgs, etc.
Then I would suggest those are the areas you should focus on first. Until you have a good understanding of OOP you will struggel with most other topics.

You could start at Visual Basic docs - get started, tutorials, reference. | Microsoft Docs[^]
 
Share this answer
 
Comments
VBeginner.NET 8-Aug-21 10:23am    
Their language is miserable for someone who is not a professional programmer. I do not understand half of the terms they use. Even if I refer to their pages to check some class or properties, it become difficult to understand. I could still go through it very quickly until I find a good book or a tutorial.
Richard MacCutchan 8-Aug-21 10:32am    
Your question states, "I have learnt the basics", so I had to assume that was true.
Classes, methods, events: these are the fundamental elements of any .NET programming - so if you don;t understand them, then whatever you do is wrong, even if it appears to work at the moment! :laugh:

They are all far too big a subject to go into in a little text box like this, but if your background in QBasic, VB3 and VB6, then what I'd suggest is that you abandon VB completely and move to C# - that way the "legacy" code that does work - sometimes - in VB.NET doesn't get in the way of your learning and using the more modern equivalents.
Because "if a VB6 function works, why bother learning the .NET way to do it?" is flawed: it's not using VB.NET, it's using VB6 in VB.NET and that means that you are genuinely making things harder for yourself. Moving from VB to C# "breaks the link" and lets you start with a clean sheet and understand what .NET is all about.

.NET is heavily event driven: each event handler has a similar signature of two parameters, an object called sender which is the class instance that raised the event, and an EventArgs (or a class derived from EventArgs) called e and they (along with this in C#, or Me in VB) are used (explicitly or implicitly) to access the controls, event information, and class instances the handler is going to work with.

Which probably makes no sense to you at all, because you don't have enough background in OOPs to know what the terms mean - especially since I suspect that your VB3 and VB6 code is probably largely QBasic in a later compiler!

You need to know this stuff - and it's not trivial to explain. Really, get a book or a course on C# and work your way through it. WHen you are done, you'll understand, and can revert to VB.NET if you want to because it's just largely a matter of syntax to do that!
 
Share this answer
 
Comments
VBeginner.NET 8-Aug-21 10:20am    
This is a very good advice. Even though it might take 50 to 100 hours to learn C# properly, it might be worthwhile.

At the same time, I am dependent on the VB6 code for my normal work, so I cannot give up VB.net entirely and recode a few projects or thousands of lines in C# immediately after that. And you are very right. It is a bit like QBasic code with GoTo statements in plenty. A lot of that cannot be translated automatically, and will need rethinking.
OriginalGriff 8-Aug-21 10:40am    
You're welcome!
Let us know how it works out ...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900