|
In what language? The MsFlexgrid was part of VB6.
There's quite some stuff on Google on the subject. What have you tried so far?
Bastard Programmer from Hell
|
|
|
|
|
Lol Really i didn't know....
I thought that better learning is in forum rather than searching in Google
|
|
|
|
|
No problem
Forums are for asking questions, not for learning. Google is for basic research. The idea is that you do some research on your project, and ask a specific question when you get stuck.
Bastard Programmer from Hell
|
|
|
|
|
Hello everyone
Does anyone know how can i insert information from combobox to listview???
in the form i have a combobox.this cbo has all the names of users.
with the pushing of a button i aim to put this name in lisview and so with all the names
Can anyone of you know how can i do it?
|
|
|
|
|
Well, it would all depend on when you are going to insert the item. Personally, I would give the user a button to press when they want to insert a selected user. Then you could just do this:-
ListView1.Items.Add(ComboBox1.SelectedItem)
in the click event handler.
Hope this helps
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Unfortunately No
The problem is that in Listview are 4 Cols
So nr (the first one)
Name (where combobox will place the data)
Thanks in advance
|
|
|
|
|
I think you should explain more clearly how you want the end result.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
in the form i have a combobox and 2 textboxes and 2 command buttons cmd 1 (insert) cmd 2 (Delete)
under them is placed one listview
Now,i have configured in loading form and everytime that forms load in the combobox are displayed some names
when you select one name and click insert,this name displayed on listview.after this you can add another name to the field and so on.
the name that you insert is displayed in col2 because col1 is dedicated to ordinal numbers (depending on how rows are in lisview.)
|
|
|
|
|
Then try something like this:-
Dim lvi As ListViewItem = New ListViewItem()
lvi.SubItems.Add(ComboBox1.SelectedItem)
ListView1.Items.Add(lvi)
That will give you the users name in the second column.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Still the same problem.seems that doesn't work
|
|
|
|
|
Well, I suggest you use the link provided by MicroVirus to learn the basics of the ListView . Then you should be able to work it out yourself.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
What you do is you add a ListViewItem via ListView.Items.Add, and store the returned ListViewItem object. Then, you can use this object to add subitems via ListViewItem.SubItems.Add.
See, for instance, MSDN ListView sample[^]
|
|
|
|
|
Maybe it's better to use ms flexgrid.but i don't know how to save flexgrid in my ms acess database.
|
|
|
|
|
Hi,
I have a public function that generates a CRC32 checksum of a file. What I am looking to add to it is a progress bar that progresses as the checksum is created.
CRC32 Function
Public Function GetCrc32(ByRef stream As System.IO.Stream) As Integer
Dim crc32Result As Integer
crc32Result = &HFFFFFFFF
Dim buffer(BUFFER_SIZE) As Byte
Dim readSize As Integer = BUFFER_SIZE
Dim count As Integer = stream.Read(buffer, 0, readSize)
Dim i As Integer
Dim iLookup As Integer
Dim tot As Integer = 0
Do While (count > 0)
For i = 0 To count - 1
iLookup = (crc32Result And &HFF) Xor buffer(i)
crc32Result = ((crc32Result And &HFFFFFF00) \ &H100) And &HFFFFFF
crc32Result = crc32Result Xor crc32Table(iLookup)
Next i
count = stream.Read(buffer, 0, readSize)
Loop
GetCrc32 = Not (crc32Result)
End Function
the function is then called when I click on a button
Dim f As FileStream = New FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, 8192)
crc = c32.GetCrc32(f)
lblCRC32.Text = Hex(crc)
How do I add a progress bar to work with the function and display the actual progress.
Thanks
J
|
|
|
|
|
What you do is you get the file length (stream.Length ) and then you divide the current amount of bytes processed by this value. If you multiply this fraction by 100 then you get the percent complete.
All you have to do then is add a progress bar to your form, set its Min to 0, Max to 100, at the start of GetCrc32 set its Value to 0 and then after every iteration you set the progressbar Value to the percent you calculated.
On a final note: you might want to do this calculating and updating the progress bar only every N iterations rather than each to avoid slowing down the function, where N is some reasonable value, like 512 or 1024 (after half and 1 KiB reads respectively).
|
|
|
|
|
Thank you for your answer but how do I know how many bytes are processed
|
|
|
|
|
Edit: sorry ignore last response, didn't read the question properly......
Anyway, You know the file length from the Stream.length as per the previous message.
You also know how my bytes are being read on each iteration on the buffer.
You add a totaliser, and with each byte read create the total read so far, then its simply: (total read so far / total length) * 100
|
|
|
|
|
DaveAuld is correct. Also, the stream.Position gives how many bytes you've read in this case.
|
|
|
|
|
Cool. Thanks guys for the help
|
|
|
|
|
I have a MDB that has 600000 records(more or less). When I'm getting data from that MDB it takes time to display the result in List, how can I make my program faster.
|
|
|
|
|
You need to either filter the results so that the user starts getting only the results that they are interested in (let's face it, no-one wants to scroll through 600000 results to find the ones they want), or you need to institute some sort of paging, i.e retrieve only a few results at a time and give the user buttons or links to go forward or backward. Unfortunately, I can only be vague in my answer as you are vague in your question. If you give us more information, perhaps we can give you more specific help.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Actually before I display any record user must input a filter. My problem is when I Open a ResultSet its takes 10 or more seconds to display to List. Is there a way to make the query fast.
|
|
|
|
|
It still seems like the resultset is too large, that is what is taking the time. In that case, you would need to set up paging and only return a few results at a time, and give the user options to move forward and back - similar to what happens here on the forums. You generally only see the first 25 / 50 posts on the page at a time and if you want to view any other posts from before you need to go to a different page.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
I's sorry but the resultset is not large, actually it returns just one record.
|
|
|
|
|
That then would point to either
1. Indexing on the database
2. Your query for getting the single result
3. Code used to execute query.
They are in the order that I would check
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|