|
Any possible different method I can use the sound-file in my application.
Also guide me as how i can come to know the compression/decompression technique.
Thank You.
|
|
|
|
|
Ishaan Karnik wrote: Any possible different method I can use the sound-file in my application.
You can use a Windows Media Player component. Drop one from the ToolBox onto your form and you can use that to play the files.
Ishaan Karnik wrote: Also guide me as how i can come to know the compression/decompression technique.
It's not technique you use in your code. Google for "what is a codec" for more information.
|
|
|
|
|
Sir, I couldnot find a Media Player Component in my toolbox. Please guide me for the same.
Thank You
|
|
|
|
|
Then add it. Right-click the ToolBox, then click on Choose Items... In the dialog that comes up, click on the COM tab, scroll down the list until you find Windows Media Player and check the box next to it. Click on OK, and you're done.
|
|
|
|
|
...normaly a WMV file contains video and audio. My.Computer.Audio.Play supports only uncompressed .WAV Audio files. Convert your file to .WAV and try again.
Regards: Didi
|
|
|
|
|
Hi,
I have a problem to understand the perforance advantage
of Buffer.BlockCopy.
If I only copy the array one time the Buffer.BlockCopy-method is much more faster
then the Array.Copy-method, but if I copy the array in a for next loop the
perforance advantage is lost.
Here is the example-code:
Dim t As Long
Dim a(50000000) As Integer
Dim b(50000000) As Integer
Dim x As Integer = Buffer.ByteLength(a) - 1
Dim y As Integer = a.Length
'Copy with Array.Copy Method 1
t = Now.Ticks
Array.Copy(a, d, y)
ListBox1.Items.Add(Now.Ticks - t)
'Copy with Buffer.BlockCopy Method 1
t = Now.Ticks
Buffer.BlockCopy(a, 0, b, 0, x)
ListBox1.Items.Add(Now.Ticks - t)
'Copy with Array.Copy Method 100
t = Now.Ticks
For i As Integer = 0 To 5
Array.Copy(a, b, y)
Next
ListBox1.Items.Add(Now.Ticks - t)
'Copy with Buffer.BlockCopy Method 100
t = Now.Ticks
For i As Integer = 0 To 5
Buffer.BlockCopy(a, 0, b, 0, x)
Next
ListBox1.Items.Add(Now.Ticks - t)
thanks in advance
andre
|
|
|
|
|
Hi,
I doubt your measurements are correct. Here is my suggestion:
put ALL the code in one big for loop, and make it run five times; then check whether the iterations all show the same behavior. I trust they will not, there typically are lots of reasons why a first iteration inside a process behaves differently.
If you want more reactions, show all the time measurement results.
|
|
|
|
|
|
Hi,
I have never used Buffer.BlockCopy myself, so I can't answer from experience.
As your link explains, the difference is in some checks that get performed; now that would be relevant only on small copy jobs, it will be relatively insignificant on the 50MB you experimented with. IMO it won't make much difference at all. The main difference is a semantic one: copying array elements versus copying bytes.
Your app's performance will depend much more on other things such as debug versus release build.
|
|
|
|
|
I am new to vb 2008. i have four textboxes. and the data is displayed in a listbox in four columns. but the columns are not formatted. like the data shows like this.
Order1 23 3 23.2
new order1 25 3 54
Order4 54 4 52.3
as you see the columns are not formatted. kindly advise me how to format columns in listbox so that data is aligned in a proper format.
|
|
|
|
|
Use a fixed-width font, such as "Courier New"
I are troll
|
|
|
|
|
thanks for your advice.
I tried that font of COURIER NEW. but the result is same. the columns data is not formatted. kindly give some other idea. or is there any option in listbox properties to align the data in columns.
|
|
|
|
|
Using a different font won't change the formatting. You can add spaces to the text so that it aligns nicely. Not a good solution, but rather a quick-fix.
A better solution is provided here[^], based on the MultiColumn property, along with a sample. This puts items in multiple columns, but those can't be considered as rows - it's a list of multiple items that continues on the second column once the first column runs out of rows.
Lastly, you could consider exchanging the ListBox for a ListView . That one does columns
I are troll
|
|
|
|
|
so there is no option for alignment of data in columns in listbox.
to add spaces is difficult. because the data is being transferred from tables and there is text of different in each row and column. like:
Coca Cola Normal
Sprite
Fanta
Pepsi
Coca Cola Zero
so it is not possible to add spaces.
can anybody have any idea to fix the problem of aligning the data in columns in listbox in vb2008
|
|
|
|
|
ListBox supports a MultiColumn[^] property that sounds like it might do what you need.
|
|
|
|
|
sazd1 wrote: so there is no option for alignment of data in columns in listbox.
It's meant as a list. If you try this;
ListBox1.MultiColumn = True
Dim i As Integer
For i = 1 To 40
ListBox1.Items.Add("Test " & i)
Next i You'll get a list of multiple items, stacked like this (that's assuming that your list has a height that has enough room for six items);
Test 1 Test 7 Test 13
Test 2 Test 8 Test 14
Test 3 Test 9 Test 15
Test 4 Test 10 Test 16
Test 5 Test 11 Test 17
Test 6 Test 12 Test 18
sazd1 wrote: to add spaces is difficult.
I have made you a short example on that;
[...]
ListBox1.MultiColumn = False
ListBox1.Font = New Font( _
System.Drawing.FontFamily.GenericMonospace, _
ListBox1.Font.Size, _
ListBox1.Font.Style, _
ListBox1.Font.Unit)
Dim j As Integer
For j = 1 To 20
ListBox1.Items.Add(AsFixedColumnText("Test " & j, 8) & _
Space(3) & _
AsFixedColumnText(Date.Now(), 8) & _
Space(3) & _
AsFixedColumnText("Hello", 3))
Next j
End Sub
Public Function AsFixedColumnText(ByVal text As String, ByVal length As Integer)
If String.IsNullOrEmpty(text) Then
Return Space(length)
Else
Return (text & Space(length)).Substring(0, length - 1)
End If
End Function
This should give you an output that's formatted in columns, similar to this;
Test 1 5/7/200 He
Test 2 5/7/200 He
Test 3 5/7/200 He
Test 4 5/7/200 He
Test 5 5/7/200 He
Test 6 5/7/200 He
Test 7 5/7/200 He
Test 8 5/7/200 He
Test 9 5/7/200 He
Test 10 5/7/200 He
Test 11 5/7/200 He
Test 12 5/7/200 He
Test 13 5/7/200 He
Test 14 5/7/200 He
Test 15 5/7/200 He
Test 16 5/7/200 He
Test 17 5/7/200 He
Test 18 5/7/200 He
Test 19 5/7/200 He
Test 20 5/7/200 He
Still, I don't think that this is the ideal solution. Is there any way that you can promote the ListBox to a ListView ? Or even a DataGridView ?
I are troll
|
|
|
|
|
Google for TabbedListbox
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hello All,
How can i got the result of two numbers while numbers length is greater then 20 digit.
which variable to use for it.
Thanks
If you can think then I Can.
|
|
|
|
|
double or possibly long
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks Dear
If you can think then I Can.
|
|
|
|
|
A long can't handle a number with 20 digits, and a double doesn't have more than 17 significant digits (losing precision beyond that).
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi,
if you have a data type that is already holding each of your two numbers, and asuming both have the same polarity, then that same data type can hold their difference for sure.
20 decimal digits is about the limit a long can hold; and it is beyond what a double can do. If you need more precision, you will have to switch to some "big integer" class; there are several around (of varying functionality and quality); there will be one included in .NET 4.0
|
|
|
|
|
Decimal.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
In VFP, Each control added to the form has a Init Method, where this is the first Method to be executed when the form runs.
Suppose I want to add A combo, and add 3 item to it.
I tried to search for method in vb and could not find it, so the only place I found to put my code for a form control is in the Form_Load()
Is there a method belong to the control so I can put my initial code in or just in Form_Load() ?
TIA
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
When the code behined is generated there is a method like public partial class formname in that method will be something like InitializeComponent(); put your initialisation after that. Or in the form load.
Never underestimate the power of human stupidity
RAH
|
|
|
|