hi all computer programming is one of those areas that i know absolutly zero about, how dialogue boxes/buttons and toolbars are created.

so went to local library and got claton walnums vb6 for dummies, this comes with a learning edition of vb6.

installed vb6 in vb6 there are toolbars/blank buttons /text boxes etc.

what i am not to sure of are all these dialogue boxes part of visual basic or any other programming language. or does vb6 take a "blank dialogue box or toolbar from say windows 98se in the same way as opening wordpad enables you to write a letter,

is it possible to create a dialogue box/toolbar with just windows on its own,even if you could not (programe that box)

thank you

Recommended Answers

All 15 Replies

I guess you can "create" a message box just in windows, without any control over it. Just open the "Run" prompt, and there's your first window. You did not program it, but did call it. Secondly, type any letter and press enter. Windows will pop up an error dialog box. there's your second box. So technically, you cannot create message boxes in windows. Although the dialog boxes you create in VB6 inherit the GUI from windows, you need some sort of developing language to create customized dialog boxes. What's more, you can create dialog boxes in windows using a web browser, by typing the following address:

javascript:alert("My Message");

But then again, you're using another language. Namely, javascript.

thanks lalo thats a bit of the mystery clearedup
thank you

You can not create a dialog box or toolbar in the same way. Let there be no mistake about it, the forms, messagebox's, dialogue boxes and all buttons are created by windows, even when you use VB. You have to have a program to actually make windows create one, and you can not do so just as a "user" of the system. Certainly, they will pop up when windows demands the need for one, but it's not going to be designable, like in VB.

While Comotose is absolutely correct, there is also vbscript for those without VB.

Put this code into a text file and rename to message.vbs.

msgbox "Your mouse has moved. Please restart your computer for the changes to take effect.",vbExclamation,"Micro$oft Window$ "

make sure it is all on one line. double click it. You should get a message box.

thanks all can someone point me in the direction of a tutoril for novices for download, and ifpossible a referance for the common commands dim etc,

the working vertion i have has no helpfile trying to find info on msdn is a nightmare .

or recommend a good book for novices please

thank you

vb in 24 hours is a good start.vb database is good.
There are so many that it gets hard to list wich ones are better.

When I am first starting a project / program. The first place I look is www.planet-source-code.com and see if there is framework I can start with or working examples if I need an re-intro to something i may have forgotton long ago.

most of the commands in vb have help with them .

create a new project. drag a button on the form. Double click the button it will create the subroutine for you, you just tell it what to do. Type 'end ' without quotes. run it .

it does abosolutely nothing until the btton is pressed which ends the program. Have fun . Post again if you still need help.

I personally find end to be ungraceful and tacky. If you do anything with hooks (especially system-wide hooks), or subclassing, and even with the use of many objects (using createobject), using "end" is an awful idea. While it's purpose was meant for good, in programming practice, is just awful. I have a made a sub I call die, which is part of my standard module (one I add to every project) and it works like this:

' /* For all The forms in the project */
for each XFrm in Forms
     ' /* Unload The Form */
     unload XFrm
next XFrm

' /* Code should never reach here, but just in case */

The "end" keyword will never be reached, but it's a catch in case something doesn't unload properly... however, unloading all the forms in the project (instead of using the violent and ungraceful "end") is the best way to go.

Agreed comatose, I use something similar. Just trying to get him started with the IDE.

*Nods and mumbles something about 10 character minimum post*

funny, haven't seen that restriction "yet"

Try posting just a wink ;)

thanks all have found some tutors vb5 night school vertion ,the learn vb in 12 easy lessons ,these are all html versions so have downloaded all the pages,

heres the problem my printer i have set to greyscale (no colour cartridge installed) most of the code is in colour say blue text) so i try to print and find i have a page with no text to follow.

if i try a split screen methode to view code and type ,as soon as i start to type code ,split screen dissapears,

so writing down some code longhand and then typing is a bit frustrating.

i was trying to follow an example on a funtion x website tutorial i downloaded,

the first line of code is

private sub optaddition_click()

dim dbl number1 as double

soon as i type dim dbl number 1 as double up pops an error message

i am writing as above

the code line is written

Dim dbl Number1 As Double

thats from memory i was under the impression in vb the upper or lower case was not an issue so cannot get past first line of code but do not know why.

thank you ps page 8 of the vb6 tutorial on funtion x to do with the algebra calculator i was trying to "draw"

because there is a space between: dbl and Number1.... you can't do that. Someone screwed up, because a variable can NOT have spaces in it.... I bet they meant:

Dim dblNumber1 As Double

thanks comatose cant blame the writer of the code i wrote it down on paper not realising that a space was causing the problem , its a pity i cannot print the darn code for easier ease of writing .

not sure if i can paste/copy code directly into vb, or use notepad/ms word or something will have a bash ,just to check my form etc is correct.

thank you

you can copy and paste into the VB IDE

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.