Click here to Skip to main content
16,014,568 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: SMTP email (gmail) Pin
Amanjot18-Feb-09 7:07
Amanjot18-Feb-09 7:07 
GeneralRe: SMTP email (gmail) Pin
Bharat Jain19-Feb-09 0:30
Bharat Jain19-Feb-09 0:30 
QuestionNot so much a programming question, more a kind of please explain why... Pin
Dalek Dave17-Feb-09 5:16
professionalDalek Dave17-Feb-09 5:16 
QuestionVBA for Excel Need Help Debugging Date Conversion Pin
codeslingerCA17-Feb-09 4:13
codeslingerCA17-Feb-09 4:13 
AnswerRe: VBA for Excel Need Help Debugging Date Conversion Pin
Dave Kreskowiak18-Feb-09 3:58
mveDave Kreskowiak18-Feb-09 3:58 
Questionload report failed while crystal report running in visual studio 2005 Pin
NaliniNagarajan17-Feb-09 2:18
NaliniNagarajan17-Feb-09 2:18 
AnswerRe: load report failed while crystal report running in visual studio 2005 Pin
tosch17-Feb-09 4:27
tosch17-Feb-09 4:27 
Generalprogress bar Pin
Aamir Mustafa17-Feb-09 1:24
Aamir Mustafa17-Feb-09 1:24 
see this routine...this routine is loading all albums and photos in from database in to tree view control
[code]
Public Sub LoadAlbums()
enlarge()
Dim i As Integer
lblAlbum.Visible = True

ProgressBar1.Visible = True

For i = 1 To 100 Step 6
ProgressBar1.Value = +i

Dim objAlbums As New Albums()
treeAlbum.Nodes.Clear()

Using oReader As SqlDataReader = objAlbums.GetAlbumsAndPhotos()

Dim AlbumNode As TreeNode
Dim PreviousAlbumID As Integer = 0
Dim CurrentAlbumID As Integer = 0
Dim AlbumDesc As String
Dim AlbumName As String
Dim PhotoName As String
Dim PhotoID As Integer
Dim PhotoData() As Byte
Dim PhotoDesc As String

Dim iAlbumId As Integer
Dim iAlbumDesc As Integer
Dim iAlbumName As Integer

Dim iPhotoID As Integer
Dim iPhotoName As Integer
Dim iPhotoData As Integer
Dim iPhotoDesc As Integer

Try
Dim imgList As New ImageList()
'Add image to represent an Album from resources


Dim albumImg As Image = My.Resources.IMG
imgList.Images.Add("Album", albumImg)
imgList.ColorDepth = ColorDepth.Depth32Bit
treeAlbum.ImageList = imgList

iAlbumId = oReader.GetOrdinal("AlbumID")
iAlbumDesc = oReader.GetOrdinal("Album_Desc")
iAlbumName = oReader.GetOrdinal("Album")

iPhotoID = oReader.GetOrdinal("PhotoID")
iPhotoName = oReader.GetOrdinal("Photo")
iPhotoData = oReader.GetOrdinal("PhotoData")
iPhotoDesc = oReader.GetOrdinal("Photo_Desc")

While oReader.Read()

CurrentAlbumID = oReader.GetInt32(iAlbumId)
If CurrentAlbumID <> PreviousAlbumID Then
AlbumName = oReader.GetString(iAlbumName)
If oReader.IsDBNull(iAlbumDesc) Then
AlbumDesc = ""
Else
AlbumDesc = oReader.GetString(iAlbumDesc)
End If
AlbumNode = AddAlbumToTree(AlbumName, AlbumDesc, CurrentAlbumID)
End If

PreviousAlbumID = CurrentAlbumID
PhotoID = oReader.GetInt32(iPhotoID)
PhotoName = oReader.GetString(iPhotoName)
PhotoData = DirectCast(oReader.GetValue(iPhotoData), Byte())

If oReader.IsDBNull(iPhotoDesc) Then
PhotoDesc = ""
Else
PhotoDesc = oReader.GetString(iPhotoDesc)
End If

AddImageToTree(AlbumNode, PhotoName, PhotoID, PhotoDesc, PhotoData)

End While

btnNewAlbum.Enabled = True
mnuNewAlbum.Enabled = True

Catch ex As Exception
MessageBox.Show(ex.ToString())
Finally
oReader.Close()
End Try

End Using
Next
Application.DoEvents()
lblAlbum.Visible = False
ProgressBar1.Visible = False

End Sub
[/code]

i want to run a progress bar as long these photos are being loaded i want that progress bar should work
i m doing as
[code]
For i = 1 To 100 Step 6
ProgressBar1.Value = +i
[/code]
but this is loading albums and photos again and again
i want that it should be work perfectly
how can i achieve above task using a progress bar or can i do that through marquee progress,if yes then how??
thanks

Aamir Mustafa
GeneralRe: progress bar Pin
Ashfield17-Feb-09 1:32
Ashfield17-Feb-09 1:32 
QuestionDrag-arrow on usercontrol in designer Pin
vigylant16-Feb-09 23:43
vigylant16-Feb-09 23:43 
QuestionVBScript logoff Pin
JR21216-Feb-09 22:27
JR21216-Feb-09 22:27 
AnswerRe: VBScript logoff Pin
DaveAuld16-Feb-09 23:20
professionalDaveAuld16-Feb-09 23:20 
GeneralRe: VBScript logoff Pin
JR21216-Feb-09 23:34
JR21216-Feb-09 23:34 
AnswerRe: VBScript logoff Pin
Dave Kreskowiak17-Feb-09 3:49
mveDave Kreskowiak17-Feb-09 3:49 
GeneralRe: VBScript logoff Pin
JR21217-Feb-09 21:14
JR21217-Feb-09 21:14 
GeneralRe: VBScript logoff Pin
Dave Kreskowiak18-Feb-09 2:13
mveDave Kreskowiak18-Feb-09 2:13 
Questionhexa Pin
aswd16-Feb-09 21:11
aswd16-Feb-09 21:11 
AnswerRe: hexa Pin
DaveAuld16-Feb-09 23:23
professionalDaveAuld16-Feb-09 23:23 
GeneralRe: hexa Pin
aswd17-Feb-09 5:03
aswd17-Feb-09 5:03 
GeneralRe: hexa Pin
EliottA17-Feb-09 5:35
EliottA17-Feb-09 5:35 
GeneralRe: hexa Pin
DaveAuld17-Feb-09 5:55
professionalDaveAuld17-Feb-09 5:55 
GeneralRe: hexa Pin
aswd17-Feb-09 15:30
aswd17-Feb-09 15:30 
GeneralRe: hexa Pin
EliottA18-Feb-09 2:21
EliottA18-Feb-09 2:21 
QuestionInserting Graphs in VB using Visual Studio Pin
EvanSaunders16-Feb-09 20:00
EvanSaunders16-Feb-09 20:00 
AnswerRe: Inserting Graphs in VB using Visual Studio Pin
DaveAuld16-Feb-09 23:27
professionalDaveAuld16-Feb-09 23:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.