|
|
Visual Basic Help - need help useing visual basic | ||
Discussion by bridenhosen with 10 Replies.
Last Update: December 17, 2010, 6:23 am | |||
Tue Mar 29, 2005 Reply New Discussion
Tue Mar 29, 2005 Reply New Discussion
- http://visualbasic.about.com/od/learnvbnet...ecvbsbs1701.htm
- http://www.eastcoastgames.com/VBA/Intro.htm
- http://www.cs.tcd.ie/Fionnuala.ODonnell/VB...9_animation.ppt (very good and comprehensive presentation)
- 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
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
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
Fri Sep 12, 2008 Reply New Discussion
Mon Jan 5, 2009 Reply New Discussion
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 mihaTue Dec 29, 2009 Reply New Discussion
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 ClassFri Dec 17, 2010 Reply New Discussion
[visual Basic] How To Confirm A Array Is Null (6)
|
(0) Visual Basic.NET Through Movies
|
Index




