General discussion

Locked

Basic VB Questions

By galahad04 ·
I am currently in the process of learning Visual Basic 6.0 and have some basic questions:

1) Is the VB "With <object>" statement analogous to a C++ constructor?

2) Is a VB class module like a C++ interface file?

3) What is the difference between an Object type and a Control type? (The reason I ask is b/c Microsoft has recommended using Object rather than Control for VB.NET compatibility best practices.)

4) Is a VB event the same thing as a Java action listener?

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Basic VB Questions

by Shanghai Sam In reply to Basic VB Questions

1 No It's like a mini "Namespace" allowing you to write

with <object>
.<property1> = <somevalue1>
.<property2> = <somevalue2>
....
end with

instead of
<object>.<property1> = <somevalue1>
<object>.<property2> = <somevalue2>
....
BUT <object> must be initialised before you can use it this is done typically thus

SET <object> = NEW <objecttype>

2 No a VB Class module is the entire source code implemetation of a single VB class

3 Essentially Control is a sub-class of Object that exposes properties + methods common to all VB widgets.

4 VB events expose similar functionality to Java action listeners but they are not as flexible

Collapse -

Basic VB Questions

by galahad04 In reply to Basic VB Questions

Poster rated this answer

Collapse -

Basic VB Questions

by galahad04 In reply to Basic VB Questions

Oops, correction: in question #2, I accidentally wrote that MS had recommended "using Object rather than Control for VB.NET compatibility best practices". I wrote this the wrong way around, it *should be* "using Control rather than Object for VB.NET compatibility best practices"

Collapse -

Basic VB Questions

by RRV In reply to Basic VB Questions

With <object> is to avoid typing the object or control name repeatedly to use the properties, methods or events exposed.
Vb class module wraps all events, methods and properties. A form is a class module which has visual interface.
Everything is object in VB. Even a control can be created as object. Object is the implementation of control or any class.
Events in VB are subroutines which executes automatically when specified actions occur. Events for most classes, controls and objects are fixed in VB. Writing your own events in Vb requires expertise in Classes creation. I would rather say little experience instead of expertise. A two years of good experience in VB [not just database programming] would be more than enough to challenge anyother platform/language developers. Especially Java.
RV

Collapse -

Basic VB Questions

by galahad04 In reply to Basic VB Questions

Poster rated this answer

Collapse -

Basic VB Questions

by galahad04 In reply to Basic VB Questions

This question was closed by the author

Back to Web Development Forum
6 total posts (Page 1 of 1)  

Related Discussions

Related Forums