|
Can I have your email address again to take this offline? I have some gifs to show you.
Thanks.
YMilan
|
|
|
|
|
When I put the images on the left in design view as automatic, when they are in a random place, i.e. image1(0), King of Hearts, they do not move at all. When I put them in manual, they move.
For some reason; and you said; but I don't understand the reason; when in State 0, I move the images, i.e. King of Hearts to the top of the hearts(0) image (a white backing gif, not King of Hearts. I did this so I can show a white backed card, so the player can see a white card instead of a black space. I can place the redbacking card no problem when the card enters the white backed card on the right. It works. However, if it is right, it doesn't drop the Image1(Index).Picture at all. It leaves it a redbacking gif.
Now, when my images on the left are randomized, and I want to pic out the King of Hearts on the left, somewhere in the shuffle, it says you're wrong when I place it over the hearts(0) position on the right. It shows a red backing but, does not say You're right or drop the card. I have that code in my hearts dragdrop; you'll see above in my last code reply. However, when I place a random card from the Image1(0) POSITION on the left, it works and says you'r right, but that is the wrong card....???? Don't understand. It leaves a redbacked gif as well, when it is the wrong card, but say's your're right.
You're helping me and I'm glad; Thank you.
|
|
|
|
|
Oh in addition, what I need to know is what setting, manual, automatic, or none do I set in design view for the one dragmode, and two oledrag properties?
|
|
|
|
|
This is what I've tried as well....still in design mode I have each image1 card set to Manual for dragmode, Automatic for oledragmode and automatic for oledropmode. Not sure what to set the hearts cards to though...tried many different modes and all seems confusing...here is my code so far: Wondering if I should have the question of whether image1(1 through 12) = Hearts(1 through 12) in the dragdrop not dragover....I tried that too, but no avail.
Public Sub Image1_Click(Index As Integer)
For Index = 0 To 12
Hearts(Index).Picture = Image1(Index).Picture
Next Index
For Index = 13 To 25
Clubs(Index).Picture = Image1(Index).Picture
Next Index
For Index = 26 To 38
Diamonds(Index).Picture = Image1(Index).Picture
Next Index
For Index = 39 To 51
Spades(Index).Picture = Image1(Index).Picture
Next Index
End Sub
Private Sub Hearts_DragOver(Index As Integer, Source As Control, _
X As Single, Y As Single, State As Integer)
For Index = 0 To 12
If State = vbEnter Then
If Source.Picture = Image1(Index).Picture Then
If Image1(Index).Picture = Hearts(Index).Picture Then
Image1(Index).Drag vbEndDrag
MsgBox ("You're Right")
Exit Sub
Else
Image1(Index).Drag vbCancel
MsgBox ("You're Wrong")
Exit Sub
End If
End If
End If
Next Index
End Sub
Private Sub Hearts_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
For Index = 0 To 12
Hearts(Index).Picture = Source.Picture
Next Index
End Sub
|
|
|
|
|
I need to attached to the event.
AddHandler client.evDeliverSm, AddressOf client_evDeliverSm
It is to enable me to receive SMS from SMSC in my SMPP client. How can I achieve this.
Thank you.
Thayhor
|
|
|
|
|
You're going to have to consult the documentation on the library that you're using. It should give you the signature of the method that you have to build so you can wire up the event handler with AddHandler.
|
|
|
|
|
Thanks for your prompt response. Actually there was no documentation on the library for now. The Moderator said I should make sure I attached to event:
AddHandler client.evDeliverSm, AddressOf client_evDeliverSm
The source code already have this;
Private Sub client_evDeliverSm(ByVal sender As Object, ByVal data As DeliverSm)
Dim messageText As String = SmppClient.GetMessageText(data.UserDataPdu.ShortMessage, data.DataCoding)
MessageBox.Show("Source: " + data.SourceAddr + "Text: " + messageText + "Coding: " + data.DataCoding.ToString())
End Sub
I just need a sample illustration. I can send sms but cannot receive.
An sample code to attached to the event will be appreciated.
Thank you.
Thayhor
|
|
|
|
|
OK, so in an appropriate place you make the AddHandler call to wire up the event. Where you put this depends on your design and code.
You already have the pieces, you just need to place them.
If there is only a specific time where it's legal for your code to receive messages, put the AddHandler in the code that sets up the receive.
|
|
|
|
|
Thank you.
I don't have any specify time to receive, I can receive from my smsc anytime. Can I leave it the way it was? or I should add a timer event;
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
AddHandler client.evDeliverSm, AddressOf client_evDeliverSm
End Sub
And when connected to smsc then enable timer1. Interval is 1sec i.e 1000.
I just want to perfect everything on my own side b/4 contacting my smsc provider which claims that shortcode "1234" have been added for me to receive sms.
Thank you.
Thayhor
|
|
|
|
|
No timers. You only need to setup the handler once, probably in Form.Load when your app starts.
|
|
|
|
|
hi,
i want to bing the checkedlistbox control with datasource,(with a table that in which i am fetching data from database.)
i am using the following code.
checkedlistbox.datasource = table
checkedlistbox.diplaymember = columnname
This is working fine.
after the execution of this code, the screen flickers and datarowview (a text) displays in the first row of checklistbox control and disappears after the control populates completely. I was using the loops to populate the control, but that was quite slow process, now the execution is faster, but the screen flickers a lot.
Please help
|
|
|
|
|
So, all you're doing is setting the DataSource and DisplayMember properties and the form is flickering constantly after that??
|
|
|
|
|
Yes, after writing this code, the checkedlistbox first row creates problem, in the first row, it shows a text dataroweview
and afterwards this text disappears and the control gets populated with the data.
Please suggest anything..
|
|
|
|
|
I am trying to play music in my application using command
My.Computer.Audio.Play (complete path , AudioPlayMode.Background).
The file I am trying to use is a wavefile(.wmv). However when the command is executed an exception is thrown saying The specified file is not PCM type wavefile. Please help regarding what i am supposed to do.
I am using Visual Studio 2008.
modified on Wednesday, May 6, 2009 2:40 PM
|
|
|
|
|
It's quite plain. The file you're trying to play is not in the correct format. Just because the file extension is WMV doesn't mean that the audio is encoded the same as every other WMV. The audio in each file, no matter what the extension, is encoded using different codecs, compressor/decompressors. But, there is a standard format called PCM (Pulse Coded Modulation) that is kind of like the Text file of the audio world. It's audio that is not compressed at all. This is the format that the Audio.Play method supports. It cannot play audio that is compressed. You have to use some kind of tool to create a new file with the audio uncompressed.
|
|
|
|
|
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.
|
|
|
|
|