|
Sorry, I have not looked at VB6 for ever 20 years, and it is long dead as a development language, so you are largely on your own. Google is the place to search for other resources.
|
|
|
|
|
No problem sir, but thank you for your time and efforts. Hopefully i get somewhere. Will post if I do.
|
|
|
|
|
Hello,
I use this code to try to sort my desktop icons, but noway...
'Declaration
'-------------
'API declarations
Public Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
LPARAM As Any) As Long
Public Const LVS_SORTASCENDING = &H10
Public Const LVM_SORTITEMS = (LVM_FIRST + 48)
'and others declarations...
'code in sub procedure
'---------------------
Public Sub sortIconsByNameAsc()
h = GetDesktopWindow() 'hwnd for desktop
Call SendMessage(h, LVM_SORTITEMS, LVS_SORTASCENDING, h)
end sub
|
|
|
|
|
Are you certain that the desktop window is actually a ListView?
|
|
|
|
|
Hey guys,
i would like to know how do i map my own keys under a variable?!!
I have this smallcode:
Private Sub Form1_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
Dim AKEY = ComboBox2.Text
If e.KeyCode = AKEY Then
End If
End Sub
Is there a way to use Letters instead of numbers in my ComboBox?
Thanks you!
modified 7-Jan-19 21:02pm.
|
|
|
|
|
Sorry ... but I don't understand what you mean or try to achieve.
You should explain 'a little bit' more ...
|
|
|
|
|
Hi..sorry..my ability to explain myself in english is low!!
I have a piece of code to play a sound and when i press a key the sound is played..
what i want is to select a key from a combobox (A/B/S/D any key) to play that sound!
Basicaly i want to map the key to play the sound via a combobox!
I hope the explanation is better now...
modified 7-Jan-19 21:02pm.
|
|
|
|
|
So you want to create a kind of Music-Keyboard ?
Why do you want to use a Combobox for that ?
What is exactly the goal ?
English is also not my first language ... but if I have a question and want an answer it is necessary to explain what I want or need. So it is up to you again ...
|
|
|
|
|
hi..
well yes...my goal is to make a drum machine that plays several drums..
The combobox would be used to map which key plays each drum!!
for eg.
Drum 1 - Combobox value "A/B/C/D Key ...etc"
Drum 2 - ComboBox2 value "A/B/C/D whatever"
I want to assign keys to my drums via several Combobox controls..so that the user might choose which key he wants for each Drum!!!
modified 7-Jan-19 21:02pm.
|
|
|
|
|
OK ... I wouldn't do it like this ... but it is your 'game' and you decide how to go ...
Actually I don't understand where your problem is.
You decided via the ComboBox-Selection which Keys from your Keyboard should work with which drums OK ... So ... where do you stuck now ?
Are you generally able to play different sounds with different Keys ?
|
|
|
|
|
I am stuck here..
Private Sub Form1_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
Dim SDrum1 = ComboBox1.Text
Dim SDrum2 = ComboBox2.Text
Select Case e.KeyCode
Case Keys.SDrum1
NoteNum = GeneralMidiPercussion.HiBongo
bPlayDrum = True
Case Keys.SDrum2
NoteNum = GeneralMidiPercussion.Vibraslap
bPlayDrum = True
End Select
End Sub
i am not able to make this conversion..i tried to convert string to integer but no result..
modified 7-Jan-19 21:02pm.
|
|
|
|
|
You don't make any conversion ...
Combobox1 (or 2) deliver you a String. So your Definition for SDrum1 and 2 must be as string - like this :
Dim SDrum1 as string = ComboBox1.Text
Dim SDrum2 as string = ComboBox2.Text
The Form.Keydown deliver you a Keycode - that is not the same as a String - but you can make a String from it.
Dim keyPressed As String = e.KeyData.ToString
Select Case keyPressed
Case SDrum1
NoteNum = GeneralMidiPercussion.HiBongo
bPlayDrum = True
Case SDrum2
NoteNum = GeneralMidiPercussion.Vibraslap
bPlayDrum = True
End Select
As what is NoteNum defined ? Integer ? Or as the same Enumeration as GeneralMidiPercussion ?
And after your Select case - what should happen after that ? And where does it happen ?
|
|
|
|
|
All right man..well i changed the code a bit the NoteNum and bPlayDrum are not needed..
Now it looks like this:
Private Sub Form1_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
Dim SDrum1 As String = ComboBox2.Text
Dim keyPressed As String = e.KeyData.ToString
Select Case keyPressed
Case SDrum1
Dim vol = volu.Value
MidiPlayer.Play(New NoteOn(0, GeneralMidiPercussion.AcousticSnare, vol))
End Select
End Sub
modified 7-Jan-19 21:02pm.
|
|
|
|
|
 Here.. the full code i have now:
Imports Toub.Sound.Midi
Imports System.Runtime.InteropServices
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MidiPlayer.OpenMidi()
End Sub
Private Sub Form1_FormClosed(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
MidiPlayer.CloseMidi()
End Sub
Private Sub Form1_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
Dim SDrum1 As String = ComboBox2.Text
Dim SDrum2 As String = ComboBox3.Text
Dim keyPressed As String = e.KeyData.ToString
Select Case keyPressed
Case SDrum1
Dim vol = volu.Value
MidiPlayer.Play(New NoteOn(0, GeneralMidiPercussion.AcousticSnare, vol))
Case SDrum2
Dim vol = volu2.Value
MidiPlayer.Play(New NoteOn(0, GeneralMidiPercussion.BassDrum, vol))
End Select
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim vol = volu.Value
MidiPlayer.Play(New NoteOn(0, GeneralMidiPercussion.AcousticSnare, vol))
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
ComboBox3.Enabled = True
ComboBox2.Enabled = True
End Sub
Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox2.SelectedIndexChanged
ComboBox2.Enabled = False
End Sub
Private Sub ComboBox3_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox3.SelectedIndexChanged
ComboBox3.Enabled = False
End Sub
End Class
I would like to have some panning on my sounds but i find it hard..cause i cannot get any info for that in Google and by my own is complicated!
modified 7-Jan-19 21:02pm.
|
|
|
|
|
What I want to know is :
Is it working like you want ?
Refering to what to wrote :
If you don't have any documentation it's allmost difficult to get further. But sometimes there is no other way than "try and error" ... 
|
|
|
|
|
hi..YES its working like i want...LOTS OF THANKS!!
i have been rumbling around and i cannot find a panorama piece of code!!!
Would you like to help me building the PANS for my sounds? (if its possible)
Thanks : )
I tried some code to insert a way of controlling by a MIDI controller..but i can only go til the part i select a device..i might leave this out of my gadget!! : (
modified 7-Jan-19 21:02pm.
|
|
|
|
|
Of course would I help you ... but I can only help you with the code ... not with your Application.
I'm still not complete understanding what you are doing ... 
|
|
|
|
|
i am doing a drum machine that is controlled by the users keyboard!
The idea is to play drums with the keyboard or MIDI controller(if i was able to insert one) like you were playing piano!
So the user chooses the keyboard keys for each drum (bassdrum, snare, cymbal etc.) and plays like it was a piano but with the keyboard!
I would like to insert also the option of connecting a MIDI Controller and play from the controller..(but thats what i say i might not be able to do it)
--- Now.. i have the sounds and the volume/velocity control...but i also would like to control the "pan" factor for each of the drums!!!
and thats all i want for this gadget!
I will make .ini file to keep the settings (they are not much) and a load/save buttons for them..probably a Master Volume control and that all!!!!
modified 7-Jan-19 21:02pm.
|
|
|
|
|
so..where do i start to make the pans for my sounds?
i am completely blind on it now!!!
modified 7-Jan-19 21:02pm.
|
|
|
|
|
I'm sorry ... but in the Moment I don't know how to help you.
As I allready wrote : I could only help you with the code - not with your application ...
|
|
|
|
|
ok..thanks anyway : ) ... you already helped me!
modified 7-Jan-19 21:02pm.
|
|
|
|
|
well..you might be able..
i was thinking..do you know which code is needed to create a master pan for sound?
I could insert variou values for the master pan..but well...i do not know what happens if the user presses 2 keys at same time?!! : S
modified 7-Jan-19 21:02pm.
|
|
|
|
|
No ... sorry ...
If I have any idea I had told it to you ...
|
|
|
|
|
OK..thank you..you already did a lot : )
modified 7-Jan-19 21:02pm.
|
|
|
|
|
Hii..
I need to know how to get continuous bill numbers, I have a query which gives Bill numbers Continuously for a month but once the month get ends the bill number will start from one again which is not required it should continue with the last bill numbers which was generated in last month...
The Query is...
stQuery = "SELECT MAX(substring(st_bill_no from 9 for 15)) FROM sc_bill WHERE dt_bill_date BETWEEN '" & _
Format(FirstDayOfMonth, "yyyy-MM-dd") & "' AND '" & _
Format(LastDayOfMonth.AddDays(1), "yyyy-MM-dd") & "'"
Thanks In Advance
|
|
|
|