progress bar
-
What he has suggested is plain not going to work. Set your progress bar Style property to Marquee and do what I said, there is just no way you can show a progress bar for an unknown number of items.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Thx for ur help I really appreciate it. ( and i m not complaining) all what i ask is a simple code please thx
Regards Ramy
-
Thx for ur help I really appreciate it. ( and i m not complaining) all what i ask is a simple code please thx
Regards Ramy
If you set the progress bar style to marquee, it will display itself automatically. Just put one on your form, and then do your database call in a thread. When the thread ends, get rid of the progress bar. I'm sorry, but I don't write VB, and really, there's no code that I can show you, you need no code for the progress bar, and I don't know how your database call is written.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Kindly,Provide me a simple code for that :) thank you
Regards Ramy
-
guys it's a vb.net application fdbcon.Open() fdbcmd.CommandText = "select * from table" dr = fdbcmd.ExecuteReader fdbcon.Open() that is all
Regards Ramy
-
If you set the progress bar style to marquee, it will display itself automatically. Just put one on your form, and then do your database call in a thread. When the thread ends, get rid of the progress bar. I'm sorry, but I don't write VB, and really, there's no code that I can show you, you need no code for the progress bar, and I don't know how your database call is written.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
thx for ur help :)
Regards Ramy
-
guys it's a vb.net application fdbcon.Open() fdbcmd.CommandText = "select * from table" dr = fdbcmd.ExecuteReader fdbcon.Open() that is all
Regards Ramy
So use the BackgroundWorker class to do this in a thread, and in it's finished event, hide the progress bar. Your only other problem is, do you also disable the rest of the UI during the call ? The easiest way to do that is have a modal call on a progress dialog, which calls the thread, and then closes itself when the call is done.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
If you set the progress bar style to marquee, it will display itself automatically. Just put one on your form, and then do your database call in a thread. When the thread ends, get rid of the progress bar. I'm sorry, but I don't write VB, and really, there's no code that I can show you, you need no code for the progress bar, and I don't know how your database call is written.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Christian Graus wrote:
I'm sorry, but I don't write VB
then start writing and THEN give your suggestions... So whats the idea?? Changing the style of the progress bar? wats the matter if u get the count of the records that has to be processed..(as i said earlier)
Christian Graus wrote:
there's no code that I can show you
but i can show you.. With flxTest .Clear .Rows = 1 .Cols = 5 Call GetConnection 'Function Set Gadors = New ADODB.Recordset GNewQuery = "SELECT * FROM test" Gadors.Open GNewQuery, Gadocn Gadors.MoveFirst Dim i As Long pg.Min = 0 'setting values of progressbar pg.Max = Gadors.RecordCount MousePointer = vbHourglass While Gadors.EOF = False i = .Rows .Rows = .Rows + 1 .TextMatrix(i, 0) = Gadors.Fields(0) .TextMatrix(i, 1) = Gadors.Fields(1) .TextMatrix(i, 2) = Gadors.Fields(2) .TextMatrix(i, 3) = Gadors.Fields(3) .TextMatrix(i, 4) = Gadors.Fields(4) If pg.Value <> Gadors.RecordCount Then pg.Value = pg.Value + 1 Gadors.MoveNext flxTest.Refresh Wend MousePointer = vbDefault End With try this one....
The name is Sandeep
-
Christian Graus wrote:
I'm sorry, but I don't write VB
then start writing and THEN give your suggestions... So whats the idea?? Changing the style of the progress bar? wats the matter if u get the count of the records that has to be processed..(as i said earlier)
Christian Graus wrote:
there's no code that I can show you
but i can show you.. With flxTest .Clear .Rows = 1 .Cols = 5 Call GetConnection 'Function Set Gadors = New ADODB.Recordset GNewQuery = "SELECT * FROM test" Gadors.Open GNewQuery, Gadocn Gadors.MoveFirst Dim i As Long pg.Min = 0 'setting values of progressbar pg.Max = Gadors.RecordCount MousePointer = vbHourglass While Gadors.EOF = False i = .Rows .Rows = .Rows + 1 .TextMatrix(i, 0) = Gadors.Fields(0) .TextMatrix(i, 1) = Gadors.Fields(1) .TextMatrix(i, 2) = Gadors.Fields(2) .TextMatrix(i, 3) = Gadors.Fields(3) .TextMatrix(i, 4) = Gadors.Fields(4) If pg.Value <> Gadors.RecordCount Then pg.Value = pg.Value + 1 Gadors.MoveNext flxTest.Refresh Wend MousePointer = vbDefault End With try this one....
The name is Sandeep
Your updating the progress bar AFTER the records have been returned, not during. Your only updaating the progress bar during the processing of each record. For a long running stored procedure that returns a set of records, or for an unknown size of the set, this won't work at all.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Christian Graus wrote:
I'm sorry, but I don't write VB
then start writing and THEN give your suggestions... So whats the idea?? Changing the style of the progress bar? wats the matter if u get the count of the records that has to be processed..(as i said earlier)
Christian Graus wrote:
there's no code that I can show you
but i can show you.. With flxTest .Clear .Rows = 1 .Cols = 5 Call GetConnection 'Function Set Gadors = New ADODB.Recordset GNewQuery = "SELECT * FROM test" Gadors.Open GNewQuery, Gadocn Gadors.MoveFirst Dim i As Long pg.Min = 0 'setting values of progressbar pg.Max = Gadors.RecordCount MousePointer = vbHourglass While Gadors.EOF = False i = .Rows .Rows = .Rows + 1 .TextMatrix(i, 0) = Gadors.Fields(0) .TextMatrix(i, 1) = Gadors.Fields(1) .TextMatrix(i, 2) = Gadors.Fields(2) .TextMatrix(i, 3) = Gadors.Fields(3) .TextMatrix(i, 4) = Gadors.Fields(4) If pg.Value <> Gadors.RecordCount Then pg.Value = pg.Value + 1 Gadors.MoveNext flxTest.Refresh Wend MousePointer = vbDefault End With try this one....
The name is Sandeep
Xandip wrote:
then start writing and THEN give your suggestions...
Most of the questions here are framework questions, which is why I can answer them. I *can* write VB, but I'd prefer not to.
Xandip wrote:
but i can show you..
Like Dave said, this won't work. What I explained, will.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Xandip wrote:
then start writing and THEN give your suggestions...
Most of the questions here are framework questions, which is why I can answer them. I *can* write VB, but I'd prefer not to.
Xandip wrote:
but i can show you..
Like Dave said, this won't work. What I explained, will.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
In the case of stored procedures, I admit what Dave said. But I dont understand why you are saying to display a progressbar in the screen just for a Show sake. Whats the use of it, if it doesnt show even the approximate time taken for loading the set of records..? The progressbar loading is used for making the user wait upto some time, till the data shows up. If its the case of stored procedures, my code can be inserted during the data loading time, because stored procedures still shows the recordcount. At least, the user can see the time spent in the data showup process.
Christian Graus wrote:
What I explained, will.
I really dont like the idea of fooling a user with your 'just for show' progressbar. I admit that my idea is not the appropriate solution, but still I can't stand with yours. The amount of time for presenting the data in front of the user can be precisely split up into the time for data retrieval + time for data viewing time for data retrieval -> this one, i admit, cannot be done time for data viewing -> but you have to admit, this one can be done
The name is Sandeep