bookmark - Visual Basic Help need help useing visual basic

Visual Basic Help - need help useing visual basic

 
 Discussion by bridenhosen with 10 Replies.
 Last Update: December 17, 2010, 6:23 am
 
bookmark - Visual Basic Help need help useing visual basic  
    
free web hosting
 
i was just wondering, when you are useing the program Visual Basic is there any way to add some animation to a form, and if so what is a good(cheep) animation program i could get?

Tue Mar 29, 2005    Reply    New Discussion   


I am going to be learning VB next year so I'll need to pay attention to this for some good pointers.

Tue Mar 29, 2005    Reply    New Discussion   

Refer to following articles for more information:

  1. http://visualbasic.about.com/od/learnvbnet...ecvbsbs1701.htm
  2. http://www.eastcoastgames.com/VBA/Intro.htm
  3. http://www.cs.tcd.ie/Fionnuala.ODonnell/VB...9_animation.ppt (very good and comprehensive presentation)
  4. http://www.vb-helper.com/index_multimedia.html (animation section)

As far as I know, you can create an animated gif image or flash file then embed them into VB form. Here is one of many tutorials on the net http://www.anim-fx.com/flash-tutorials/insertvb6.html

Wed Mar 30, 2005    Reply    New Discussion   

Note for beginers, the words placed in single quotation marks are comments
Heheheh. This is easy. Very easy.

Quick Solutions

In VB6, you just need the default controls. Importantly, the Image control (not picture control using that would kill the cpu) and a Timer control.

Prepare the slides of the animation. You could do this by taking frame by frame shots of a movie, gif animation, etc. Best way to experiment is with... STICK FIGURES!!! (fine, be Van Goh if you want. But you'll die at frame 3)

Rename the frames from 1 to say 32 same file extentions (say .bmp) put it in a folder called Animation1/
Then, create one image control (I hereby declare this control by its default name, Image1).
Next, add the Timer Control (blah blah blah as above, Timer1)
Set the timer's interval. This will become the the animation's frame interval.
Set the timer's enabled to false if you want to pause it, set to true for resuming.

Then add this nifty code to the same form as the controls:

CODE


Dim ImgCounter as Integer 'Use Long if you plan to make a movie out of this'
Private Const AniMax as Integer = 33 'Change the number if you like (last frame + 1)'
Private sub Timer1_Timer()
ImgCounter = ImgCounter + 1
Image1.Picture = LoadPicture(App.Path & "/Animation1/" & Trim(Str(ImgCounter)) & ".bmp" 'change file extention if necessary')
If ImgCounter = AniMax Then
ImgCounter = 0 'Not 1 or else the next time this function repeats, it'll skip frame 1'
End If
End Sub

Public Function Frame_GoTo(iFrame as Integer)
If iFrame < AniMax And iFrame > 0 Then
ImgCounter = iFrame
Image1.Picture = LoadPicture(App.Path & "/Animation1/" & Trim(Str(ImgCounter)) & ".bmp")
End If
End Function


There. With the extra function you can go to any frame within the range by calling it up. You do this by entering the code:
Frame_GoTo('frame no.')
Ta da! The simple animation ready to roll.

Second Alternative: Create a .avi, .mpeg or .mp4 file and embed it with the program. Instant animaiton. Eats the RAM though, so be careful.

Fri Oct 13, 2006    Reply    New Discussion   


QUOTE

As far as I know, you can create an animated gif image or flash file then embed them into VB form.


the visual studio 2005 professional version comes with animations that have to be installed as a optional item. They include all of the animations that were used in earlier versions of windows and include ones like the file copy dialog, file delete, upload to ftp, download files et etc. They are pretty simple but it that is something you are looking for, they can be useful.

because they are so large i cannot post them here on the board, but i will try and put them up on my astahost site. ill reply again when they are up! the zipped version is rather large (2.03MB) so be warned!

also, since you can embed almost any gif animation into a vb form then any animated gif that you come across on the internet you could possibly use. There are many sites (i wont list them now, but do some googling and you'll find some) that give away animations for royalty-free use.

but remember, the more animations and pictures that you add to your forms, the slower the form is going to become to load which will in effect slow down your entire application, so use wisely!

good luck
-jimmy

Wed Jan 17, 2007    Reply    New Discussion   

where is my mistake?
Visual Basic Help

I'm trying to complete this code and I'm getting the code from the book.
The code is: Private Sub Form_Load()
' Initialize the label's text
Dim strLabel1 As String
Dim strLabel2 As String
Dim StrLabel3 As String
Dim StrLabel4 As String

StrLabel1 = "use frames if you want"
StrLabel2 = " to group options together"
StrLabel3 = " Each frame forms one set"
StrLabel4 = " of option buttons"

LblFrames.Caption= strLabel1&strLabel2&strLabel3&strLabel4

End Sub

Now the problem is with the last line , it didn't accept the ampersand after every string name . If you can help with that , please reply. Thank you

-question by new student

Sun Aug 3, 2008    Reply    New Discussion   

QUOTE (iGuestnew student)

where is my mistake?

Visual Basic Help
I'm trying to complete this code and I'm getting the code from the book.
The code is: Private Sub Form_Load()
' Initialize the label's text
Dim strLabel1 As String
Dim strLabel2 As String
Dim StrLabel3 As String
Dim StrLabel4 As String

StrLabel1 = "use frames if you want"
StrLabel2 = " to group options together"
StrLabel3 = " Each frame forms one set"
StrLabel4 = " of option buttons"

LblFrames.Caption= strLabel1&strLabel2&strLabel3&strLabel4

End Sub

Now the problem is with the last line , it didn't accept the ampersand after every string name . If you can help with that , please reply. Thank you

-question by new student
Link: view Post: 126648


The solution is very simple, just add spaces between the string names and the & signs, like this:

LblFrames.Caption = strLabel1 & strLabel2 & strLabel3 & strLabel4

Thu Sep 11, 2008    Reply    New Discussion   

how can i chang extention to each other ? for example how a program written bye vb can convert a gif file to jpg, or other ? this is project for my teacher i have to done.

Fri Sep 12, 2008    Reply    New Discussion   

Visual Basic, Run-time error Visual Basic HelpVisual Basic, Run-time error '-1 (ffffffff) 'ENGLISHHistory:1)A program that I developed with VB6 runs perfectly in my old computerin programing way and in executable way, with a Pentium(are) 4 CPU 1,6GHz, Window XP.2) Now I have a new computer with Intel Core(TM)2D core, E7300 2,66 GHz, Window XP, when running the program in programway it works during one time but suddenly he gives the suitable error,Run-time error ` -1 (ffffffff) ' and the strange is that whenrequesting help the system doesn't respond and I have to cancel it.Nevertheless if I work on my new PC with the executable (*.Exe) of the same program this works and doesn't give errorESPAŅOLHistoria1)Unprograma que desarrollč con VB6 corre perfectamente en mi viejacomputadora en modo de programaciōand y en modo ejecutable, con unPentium(are) 4 CPU 1,6 GHz, Window XP.2) Ahora tengo una nuevacomputadora con Intel Core(TM) 2D core, E7300 2,66 GHz. Window XP, alcorrer el programa en modo de programaciōand, čste trabaja durante untiempo pero repentinamente the el error indicado, Rin-time error `-1(ffffffff)' y lo mās extraņo es que al solicitar ayuda el sistema noresponde y tengo que cancelarlo.No obstante si trabajo en mi nueva PC con el ejecutable del mismo programa este trabaja bičand y no the error.-reply by Ernesto Gramcko

Mon Jan 5, 2009    Reply    New Discussion   

help vb6 browser webVisual Basic Help

Hy,

I have just made a browser web in vb6 and  I don't know how to add favorites? Any ideas please ???  I have found ideas about adding favorites but in vb.Net

-reply by miha

Tue Dec 29, 2009    Reply    New Discussion   

Determine the average number of letters in the words of a sentence.Visual Basic HelpI am trying to debug this to find and correct the errors. Please Help. Thank you.

Here is the code:

CODE

Private Sub btnCount_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCount.Click 'Determine word count and average letters / word in the sentence Dim iLength As Integer 'length of string Dim iWords As Integer 'number of words in sentence Dim iLetterCount As Integer 'count of letters Dim sWord As String 'current word Dim sPrevLetter As String 'previous letter Dim x As Integer 'loop counter Dim sLetter As String 'current letter from sentence Dim sLine As String = txtInput.Text.Trim.ToLower 'entered text - no leading or trailing spaces - make all lowercase Try iLength = sLine.Length If iLength = 0 Then 'nothing entered MessageBox.Show("Please enter a sentence.") Else End If sWord = "" sPrevLetter = "" For x = 0 To iLength sLetter = sLine.Chars(x) 'get Next Letter Select Case sLetter Case "a" To "z" 'we are in a word - increment letter counter sWord &= sLetter Case Else 'we are in a break between words If sPrevLetter <> " " Then 'we don't want to count succesive spaces as a word 'add word to list lstLetters.Items.Add(sWord) sWord = "" 'reset for next word End If End Select sPrevLetter = sLetter Next If sWord <> "" Then lstLetters.Items.Add(sWord) End If Catch ex As Exception MessageBox.Show(ex.Message) End Try lblWordCount.Text = "Words Counted: " & lstLetters.Items.Count lblAverage.Text = "Average letters per word: " & iLetterCount / iWords End Sub Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click 'clear all display and input controls txtInput.Clear() End Sub Private Sub txtInput_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtInput.TextChanged End SubEnd Class

Fri Dec 17, 2010    Reply    New Discussion   

Quickly Post to Visual Basic Help need help useing visual basic w/o signup Share Info about Visual Basic Help need help useing visual basic using Facebook, Twitter etc. email your friend about Visual Basic Help need help useing visual basic Print
Reply / Comment Ask a Question? Share / Bookmark E-Mail a Friend Print

[visual Basic] How To Confirm A Array Is Null   [visual Basic] How To Confirm A Array Is Null (6) (0) Visual Basic.NET Through Movies   Visual Basic.NET Through Movies