Archived

This topic is now archived and is closed to further replies.

Tevong

Visual Basic help needed

Recommended Posts

I find VB incredibly boring but I''m only learning it cause I have to. Is it possible to make games using DirectX in VB? t would make it more interesting. Or make extensions of programs using C++? Anyway I''m still learning so here''s some questions: 1-How do I use the timer control to control something like the intervals between a traffic light change? I set the intervals to 1000 milliseconds then I tried select case timer.index case 0 to 10 ... case 10 to 20 ... end select but it returns an error. Couldn''t find any other properties of timer I could use. 2-How do I do word wrap in my text boxes? It sounds simple but I can''t find a wordwrap property anywhere. 3-How do I use the clipboard, so I can make a simple text editor with cut and paste command buttons? 4-Next year (when I''ll know more about VB) we have to do a major project. Any ideas of something fun I could do? Thanks.

Share this post


Link to post
Share on other sites
quote:
Original post by Tevong
I find VB incredibly boring but I''m only learning it cause I have to.

do you know any other languages?
quote:
Is it possible to make games using DirectX in VB?

yes (as of directX 7).
quote:
Or make extensions of programs using C++?

i don''t know exactly what you mean. you can write a DLL or something in c++, and then use it in VB; i don''t know if c++ can use something created with VB, but why the hell would anyone want to do that anyways?
quote:
1-How do I use the timer control to control something like the intervals between a traffic light change?

that isn''t how the timer control works. you set the "interval" property to the number of milliseconds (1000 = 1 second), and set the "enabled" property to true. then, every time that amount of time passes (every second, with my example), it triggers the timer event. you put the code that is to be executed within the timer_timer event. put a timer control on a form, and double-click it; the editor will take you to the proper place in the code and you can learn from there.
quote:
2-How do I do word wrap in my text boxes? It sounds simple but I can''t find a wordwrap property anywhere.

with text controls, it is called "multi-line"... set it to true and you get a multi-line text box with word wrap. remember to set the "scrollbars" property if you want those too.
quote:
3-How do I use the clipboard, so I can make a simple text editor with cut and paste command buttons?

oh, um... i don''t remember. but it is pretty easy to do. maybe someone else will tell you.
quote:
4-Next year (when I''ll know more about VB) we have to do a major project. Any ideas of something fun I could do?

games are fun, but they take a hell of a lot longer to make than most people think (including a good deal of programmers and game designers). don''t worry about it yet though, if it isn''t next year

--- krez (krezisback@aol.com)

Share this post


Link to post
Share on other sites
Check out the clipboard object.

And if you find VB boring, then surely you should understand it enough to know what the index property of a control is.

If you want to do proper word wrap, then as well as doing the multi-line property, you will need to write some of your own code so it doesn''t chop up words. If you find it boring, then this should be a simple task.

Yes, I''m surly today... nothing personal

Trying is the first step towards failure.

Share this post


Link to post
Share on other sites
quote:
Original post by Tevong
4-Next year (when I''ll know more about VB) we have to do a major project. Any ideas of something fun I could do?



Try The Scrolling Game Development Kit for ideas. If you want to write your own VB program, you could use the kit for basic design and ideas on a scrolling game, then write your code, using the kit''s source code as an example (it''s open source).

Or if you want to build on what''s there using your VB experience, you could utilize the scripting support offered by the kit (VBScript) to customize your game.

"All you need to do to learn circular logic is learn circular logic"

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Well,...

If what you want to know if you can make games with vb, i''ll respond: You can make games with every langage on this earth.

Furthermore, with DirectX or OpenGL, the game are even faster,
but, before learning DirectX or OGL, you should first understand how the language works.

It''s not complicated, there''s only some instructions to know and the rest is only methods proper to other api''s such as DX or OGL.

To use the clipboard, suppose that you have a textbox named Text1, then the code is:

Clipboard.Clear
Clipboard.SetText Text1.Text

This code copies data into clipboard. The inverse process (getting data):

Text1.Text = Clipboard.GetText()

Remember, VB isn''t boring at all. It''s a quite powerful and very simple language. If you plan to move to c++, you should first understand it well.

For more information about VB or GameProgramming in VB:
http://www.vbexplorer.com
http://www.damberg.de
http://www.chez.com/scribe/en/index.htm

Share this post


Link to post
Share on other sites
quote:
Original post by ragonastick
If you want to do proper word wrap, then as well as doing the multi-line property, you will need to write some of your own code so it doesn''t chop up words.

actually, it will do it just fine automatically...
quote:
Original post by Tevong
What I want to know is how to use DirectX in VB. Could you give me an idea of how I would go about using it?

download the SDK... or look at the hundreds of tutorials about this subject here on gamedev.net, or pop up when you type "vb directx tutorial" in google...

--- krez (krezisback@aol.com)

Share this post


Link to post
Share on other sites