Quantcast

Maximum PC

It is currently Fri Apr 18, 2014 2:02 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 20 posts ] 
Author Message
 Post subject: I need some help with Visual Basic.NET 2003
PostPosted: Tue Jul 27, 2004 1:43 pm 
8086
8086

Joined: Mon Jul 26, 2004 8:40 am
Posts: 55
Location: Illinois, in the U.S. of A.
I took the full Visual Basic 6 course in high school, but Visual Basic.NET 2003 is so much different, I can't make the programs that I could in VB6.

First off, how do I get it to switch the focus from one form to another? In VB 6, you would say, for example, "Form2.Show". In VB.NET 2003, that won't work. I tried something like "Form2.ActiveForm.Show", and it still didn't show. Someone plus let me know how to get, for example, Form2 to pop up in front (have the focus), and get Form1 to hide.


Top
  Profile  
 
 Post subject: Re: I need some help with Visual Basic.NET 2003
PostPosted: Tue Jul 27, 2004 2:05 pm 
Thunderbird
Thunderbird
User avatar

Joined: Wed Jul 07, 2004 1:13 pm
Posts: 817
Location: Missouri
Derek § wrote:
I took the full Visual Basic 6 course in high school, but Visual Basic.NET 2003 is so much different, I can't make the programs that I could in VB6.

First off, how do I get it to switch the focus from one form to another? In VB 6, you would say, for example, "Form2.Show". In VB.NET 2003, that won't work. I tried something like "Form2.ActiveForm.Show", and it still didn't show. Someone plus let me know how to get, for example, Form2 to pop up in front (have the focus), and get Form1 to hide.


I don't know much about anything .NET. In fact I hate .NET all together. MS ruined VB as far as I am concerned. But to help a little. There is a very good website that has an actual guide in just about everything you can think of. Go to vb.about.com and they have lots of info on VB 6 and VB.NET. They should be able to have some information that can help you.


Top
  Profile  
 
 Post subject: Re: I need some help with Visual Basic.NET 2003
PostPosted: Tue Jul 27, 2004 3:13 pm 
Java Junkie
Java Junkie
User avatar

Joined: Mon Jun 14, 2004 10:23 am
Posts: 24218
Location: Granite Heaven
baldeagle wrote:
MS ruined VB as far as I am concerned.


:lol: MS ruined VB from the start. I hate that language.

If anything, the .NET framework has made it more viable as a programming language. I still don't like it, but I have less hatred. ;)

This is, of course, all just personal opinion, and unfortunately, doesn't help Derek ... sorry Derek, but I don't use VB so I'm not familiar with the syntax. :(


Top
  Profile  
 
 Post subject:
PostPosted: Tue Jul 27, 2004 4:02 pm 
In the lab!
In the lab!
User avatar

Joined: Sun Jun 06, 2004 10:47 am
Posts: 831
Location: Secret Laboratory
in .net forms are now just classes/objects. you no longer build a form and just access it as form2 in your code. so to use a form you need to create a new instance of it first.

in the public declearation area of form1 do a
dim bob as new form2

from now on in your code you use the reference of bob when you mean the form2

then to open and show the form you use
bob.show()

to give it focus you use
form2.activate()

here's a good msdn tutorial on the new way .net does forms.

and offtopic but MS didn't ruin VB they just cleaned it up so it works more like other languages with full OO, threading, etc support. as a result they did destoy a lot of backwards compatibility but in the long run I think it's a good thing.


Top
  Profile  
 
 Post subject:
PostPosted: Tue Jul 27, 2004 5:08 pm 
Java Junkie
Java Junkie
User avatar

Joined: Mon Jun 14, 2004 10:23 am
Posts: 24218
Location: Granite Heaven
Nice explanation, Dex. :) I had heard that .NET was more OOP oriented, but didn't want to say it out loud in case I was wrong. I'm a pretty weak windows programmer.


Top
  Profile  
 
 Post subject: Re: I need some help with Visual Basic.NET 2003
PostPosted: Tue Jul 27, 2004 10:58 pm 
Bitchin' Fast 3D Z8000*
Bitchin' Fast 3D Z8000*
User avatar

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
Derek § wrote:
I took the full Visual Basic 6 course in high school, but Visual Basic.NET 2003 is so much different, I can't make the programs that I could in VB6.

First off, how do I get it to switch the focus from one form to another? In VB 6, you would say, for example, "Form2.Show". In VB.NET 2003, that won't work. I tried something like "Form2.ActiveForm.Show", and it still didn't show. Someone plus let me know how to get, for example, Form2 to pop up in front (have the focus), and get Form1 to hide.

Based on Dex's post - you're going to want to spend some time learning how to program in an OOP language. OOP will be confusing at first, but sooner than later, you'll 'get it' and add a very powerful tool to your toolkit.


Top
  Profile  
 
 Post subject:
PostPosted: Wed Jul 28, 2004 2:02 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Sat Jun 26, 2004 3:44 pm
Posts: 513
Location: Vancouver Island
.NET is here to stay...so if VB.NET and C#...

Jip recommendation will work fine.

Transitioning from VB 6.0 and VB.NET is sometimes night and day. You are entering quasi-systems level now. VB.NET is still business language, and it's syntax is easy to follow, but you can SO much more with it than VB 6.0.

What sort of windows are you using? You can do what you're doing using MDI windows, but they have limitations (ie they must stay inside the confines of the program), but are simpler to work with.


Top
  Profile  
 
 Post subject: Re: I need some help with Visual Basic.NET 2003
PostPosted: Wed Jul 28, 2004 6:31 pm 
Thunderbird
Thunderbird
User avatar

Joined: Wed Jul 07, 2004 1:13 pm
Posts: 817
Location: Missouri
Gadget wrote:
Derek § wrote:
I took the full Visual Basic 6 course in high school, but Visual Basic.NET 2003 is so much different, I can't make the programs that I could in VB6.

First off, how do I get it to switch the focus from one form to another? In VB 6, you would say, for example, "Form2.Show". In VB.NET 2003, that won't work. I tried something like "Form2.ActiveForm.Show", and it still didn't show. Someone plus let me know how to get, for example, Form2 to pop up in front (have the focus), and get Form1 to hide.

Based on Dex's post - you're going to want to spend some time learning how to program in an OOP language. OOP will be confusing at first, but sooner than later, you'll 'get it' and add a very powerful tool to your toolkit.


My second C++ class at Baker College was all OOP targeted. In fact the name of the class was OOP with C++ LOL. I hated the way the class was taught. I was hoping the instructor would show us how to use the GUI along with the command prompt but all we did was VM apps.

The concepts and theories were great and the book was amazing. If fact I still have the book. But I just did not like the way the instructor taught the class, his methods toward interacting with students and providing information.


Top
  Profile  
 
 Post subject: Re: I need some help with Visual Basic.NET 2003
PostPosted: Thu Jul 29, 2004 12:02 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 985
Location: Earth
baldeagle wrote:
My second C++ class at Baker College was all OOP targeted. In fact the name of the class was OOP with C++ LOL. I hated the way the class was taught. I was hoping the instructor would show us how to use the GUI along with the command prompt but all we did was VM apps.


That's because GUI != OOP. The principle behind OOP is a new design methodology, so it encompasses any kind of GUI/CLI program out there. OOP is not meant for it, GUI development is all about widgets, dialogues, etc., OOP has nothing to do with it. In fact, MFC/Win32 programming is based on structures, it wasn't OOP at all. In fact, Structures break that rule.

Anyhow, OOP is a nice touch and it's helped me in my projects. I'm self-taught in OOP so I'm not as well versed in OOP as I should be.


Top
  Profile  
 
 Post subject:
PostPosted: Thu Jul 29, 2004 4:36 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Sat Jun 26, 2004 3:44 pm
Posts: 513
Location: Vancouver Island
I would argue that modern GUI is very object orientated and based. While the underlying gui classes may not be, the structure of their event driven reuseability is what OOP is about.

OOP is all about reuseability to improve upon the concepts in functionalism first taught with C. When, however, you talk about hardcore OOP...but then, no one will ever be able to appreciate the sublime beauty of a pure OOP design...simply because it's never been designed in a practical system.

In my opinion, GUI programming can be both.


Top
  Profile  
 
 Post subject:
PostPosted: Thu Jul 29, 2004 7:51 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 985
Location: Earth
Wolfmann wrote:
In my opinion, GUI programming can be both.


The implementation of the GUI framework can follow the rules of OOP, but to say that an OOP lecture should involve GUI programming is the wrong mentality. Going back towards the old school days, a lot of the framework is based off of C. Heck, X11 - if I'm not mistaken - still uses a lot of C code but in retrospect, current iterations of X11 are modern.


Top
  Profile  
 
 Post subject:
PostPosted: Thu Jul 29, 2004 8:25 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Sat Jun 26, 2004 3:44 pm
Posts: 513
Location: Vancouver Island
As I said, a pure OOP project is not practical. For teaching and instruction, sure...but who really uses consoles anymore except for low order communications.

GUI provides a framework...it's part of the IPO model of computer processing. It is almost it's own concept in and of itself, much like OOP or functionalism are.


Top
  Profile  
 
 Post subject:
PostPosted: Thu Jul 29, 2004 10:20 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 985
Location: Earth
Wolfmann wrote:
As I said, a pure OOP project is not practical. For teaching and instruction, sure...but who really uses consoles anymore except for low order communications.


If you're working on a project, sure. Heck, nothing would get done. But this was a class, and OOP can be taught properly without having to teach GUI at all. Heck, our OOP class doesn't even touch GUI. You learn the principles of OOP in that class.

Wolfmann wrote:
GUI provides a framework...it's part of the IPO model of computer processing. It is almost it's own concept in and of itself, much like OOP or functionalism are.


Sure it does, but OOP fits in design which encompasses what GUI you are going to use or how you implement the GUI. The idea of OOP is design strictly, it teaches you how to break down the components such that they are sets of classes, how those objects communicate with each other, and moreover, how those classes are related and grouped together.

All that can be taught sans a GUI framework. You write apps to test the theory, and that can be done without a need for a GUI framework. When I was teaching myself OOP back in the day, I pretty much learned everything via Console based apps. Never even conceived of using a GUI at the time.


Top
  Profile  
 
 Post subject:
PostPosted: Mon Aug 02, 2004 9:55 am 
8086
8086

Joined: Mon Jul 26, 2004 8:40 am
Posts: 55
Location: Illinois, in the U.S. of A.
Dexter wrote:
in .net forms are now just classes/objects. you no longer build a form and just access it as form2 in your code. so to use a form you need to create a new instance of it first.

in the public declearation area of form1 do a
dim bob as new form2

from now on in your code you use the reference of bob when you mean the form2

then to open and show the form you use
bob.show()

to give it focus you use
form2.activate()

here's a good msdn tutorial on the new way .net does forms.

and offtopic but MS didn't ruin VB they just cleaned it up so it works more like other languages with full OO, threading, etc support. as a result they did destoy a lot of backwards compatibility but in the long run I think it's a good thing.

Thanks Dexter. Now that you showed me that, it makes since, from what I got from the error message.

I don't really care for VB myself. I'll be taking Visual C++ this year in High School, and I'm sure I'll crap the VB. It's just that I got VB.NET 2003 Standard Edition for free through a promo offer. You can't be free! :D

I eventually want to get the DirectX 9 SDK, but I'm sure I have some DirectX programming learning to do first.


Top
  Profile  
 
 Post subject:
PostPosted: Mon Aug 02, 2004 9:08 pm 
Bitchin' Fast 3D Z8000*
Bitchin' Fast 3D Z8000*
User avatar

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
Wolfmann wrote:
OOP is all about reuseability to improve upon the concepts in functionalism first taught with C. When, however, you talk about hardcore OOP...but then, no one will ever be able to appreciate the sublime beauty of a pure OOP design...simply because it's never been designed in a practical system.

Just to be a nit-picky brat... :)

OOP is really about modularity. The increased modularity is what provides most of the benefits of OOP, including better reusability.


Top
  Profile  
 
 Post subject:
PostPosted: Mon Aug 02, 2004 9:12 pm 
Bitchin' Fast 3D Z8000*
Bitchin' Fast 3D Z8000*
User avatar

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
DJSPIN80 wrote:
All that can be taught sans a GUI framework. You write apps to test the theory, and that can be done without a need for a GUI framework. When I was teaching myself OOP back in the day, I pretty much learned everything via Console based apps. Never even conceived of using a GUI at the time.

Which is a useful technique since beginners (hell, even most intermediates and beyond) won't have the required OOP knowledge to use something like the MVC design pattern to seperate the gui from the logic of the application. IMO, learning to use OOP is more than enough of a mindspin w/o getting a gui or event-driven design issues involved. :)


Top
  Profile  
 
 Post subject:
PostPosted: Tue Aug 03, 2004 7:27 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 985
Location: Earth
Gadget wrote:
DJSPIN80 wrote:
All that can be taught sans a GUI framework. You write apps to test the theory, and that can be done without a need for a GUI framework. When I was teaching myself OOP back in the day, I pretty much learned everything via Console based apps. Never even conceived of using a GUI at the time.

Which is a useful technique since beginners (hell, even most intermediates and beyond) won't have the required OOP knowledge to use something like the MVC design pattern to seperate the gui from the logic of the application. IMO, learning to use OOP is more than enough of a mindspin w/o getting a gui or event-driven design issues involved. :)


Yeah, I remember talking to my old supervisor who claimed he knew OOP. Came to find out that because PHP had classes, therefore, he knew OOP. He didn't even know what polymorphism is (not that I know it to the nth degree, but I have a general idea on what it is). Most people I talk to in school don't know OOP, and they associate OOP with GUI: partly the reasoning lies in that GUI uses Objects, and OOP is about objects, therefore, OOP == GUI. While the logic is there, the reasoning is definitely flawed.


Top
  Profile  
 
 Post subject:
PostPosted: Tue Aug 03, 2004 8:33 am 
Thunderbird
Thunderbird
User avatar

Joined: Wed Jul 07, 2004 1:13 pm
Posts: 817
Location: Missouri
DJSPIN80 wrote:
Gadget wrote:
DJSPIN80 wrote:
All that can be taught sans a GUI framework. You write apps to test the theory, and that can be done without a need for a GUI framework. When I was teaching myself OOP back in the day, I pretty much learned everything via Console based apps. Never even conceived of using a GUI at the time.

Which is a useful technique since beginners (hell, even most intermediates and beyond) won't have the required OOP knowledge to use something like the MVC design pattern to seperate the gui from the logic of the application. IMO, learning to use OOP is more than enough of a mindspin w/o getting a gui or event-driven design issues involved. :)


Yeah, I remember talking to my old supervisor who claimed he knew OOP. Came to find out that because PHP had classes, therefore, he knew OOP. He didn't even know what polymorphism is (not that I know it to the nth degree, but I have a general idea on what it is). Most people I talk to in school don't know OOP, and they associate OOP with GUI: partly the reasoning lies in that GUI uses Objects, and OOP is about objects, therefore, OOP == GUI. While the logic is there, the reasoning is definitely flawed.


The reasoning is flawed because all they know is either Windows or OS X. If only they knew about the power available from the command line in OSX. I have read a few articles about it, but I have not used a Apple OS in years. My work and school uses Windows only. Got to go with what they require lol.

It is easier for people to think of buttons as object than what programmers consider objects. For my final project in OOP with C++ we had to simulate any real world object we wanted. There were requirements for it to be valid. I decided to do mine on bouncing and rolling a ball. LOL. Nothing fancy but great fun and excellent learning experience.


Top
  Profile  
 
 Post subject:
PostPosted: Tue Aug 03, 2004 1:22 pm 
Bitchin' Fast 3D Z8000*
Bitchin' Fast 3D Z8000*
User avatar

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
DJSPIN80 wrote:
Gadget wrote:
DJSPIN80 wrote:
All that can be taught sans a GUI framework. You write apps to test the theory, and that can be done without a need for a GUI framework. When I was teaching myself OOP back in the day, I pretty much learned everything via Console based apps. Never even conceived of using a GUI at the time.

Which is a useful technique since beginners (hell, even most intermediates and beyond) won't have the required OOP knowledge to use something like the MVC design pattern to seperate the gui from the logic of the application. IMO, learning to use OOP is more than enough of a mindspin w/o getting a gui or event-driven design issues involved. :)


Yeah, I remember talking to my old supervisor who claimed he knew OOP. Came to find out that because PHP had classes, therefore, he knew OOP. He didn't even know what polymorphism is (not that I know it to the nth degree, but I have a general idea on what it is). Most people I talk to in school don't know OOP, and they associate OOP with GUI: partly the reasoning lies in that GUI uses Objects, and OOP is about objects, therefore, OOP == GUI. While the logic is there, the reasoning is definitely flawed.

Yeah - the more I think about it, the more I like the idea of seperating the teaching about a gui from teaching about OOP. It really muddies the waters and both of the those topics are complex enough and important enough to warrant seperate treatment (even in a begining Java, C#, VB course). I guess this is one area where C++ has a bit of an advantedge as a teaching language.


Top
  Profile  
 
 Post subject:
PostPosted: Tue Aug 03, 2004 1:49 pm 
Bitchin' Fast 3D Z8000*
Bitchin' Fast 3D Z8000*
User avatar

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
baldeagle wrote:
DJSPIN80 wrote:
Gadget wrote:
DJSPIN80 wrote:
All that can be taught sans a GUI framework. You write apps to test the theory, and that can be done without a need for a GUI framework. When I was teaching myself OOP back in the day, I pretty much learned everything via Console based apps. Never even conceived of using a GUI at the time.

Which is a useful technique since beginners (hell, even most intermediates and beyond) won't have the required OOP knowledge to use something like the MVC design pattern to seperate the gui from the logic of the application. IMO, learning to use OOP is more than enough of a mindspin w/o getting a gui or event-driven design issues involved. :)


Yeah, I remember talking to my old supervisor who claimed he knew OOP. Came to find out that because PHP had classes, therefore, he knew OOP. He didn't even know what polymorphism is (not that I know it to the nth degree, but I have a general idea on what it is). Most people I talk to in school don't know OOP, and they associate OOP with GUI: partly the reasoning lies in that GUI uses Objects, and OOP is about objects, therefore, OOP == GUI. While the logic is there, the reasoning is definitely flawed.


The reasoning is flawed because all they know is either Windows or OS X. If only they knew about the power available from the command line in OSX. I have read a few articles about it, but I have not used a Apple OS in years. My work and school uses Windows only. Got to go with what they require lol.

Not really, a class doesn't have to be 'run' from a command line or gui to be useful. For example, you could have passed me your Ball class, which contains methods like getSize, getColor, getTexture, etc - and then I can run it from a gui or cli. So the cli vs gui app thing is really not all that important.


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group