|
Make sure the timers are stopped before you unload the form.
Timer1.Enabled = False
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
That does not seem to work I have about 12 timers 1 is causing me problems..
If world(charlc).Tag = "testchar" Then
MsgBox ("You beat the level!")
isenemyshooting.Enabled = False
leveltime.Enabled = False
bullet.Enabled = False
enemy.Enabled = False
enemyshooter.Enabled = False
score = score + Timerlevel
scores.Caption = score
Timerlevel = -1
greencircles.Caption = Life
level2.Show
level1.Hide
Unload Me
End If
All of my timers have been disabled. So im Completely confused. Help me please! (NOTE: THIS IS UNDER the Leveltime timer.)
My Code Has Fallen and can't Get up
|
|
|
|
|
If your form unloads then mysteriously reloads itself, it's because something has a reference to it, like a timer you forgot about (Tick callback), or another piece of code in another form is calling a method on your form.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yeah, Thanks alot again. I found out that an every other form it was referencing back to it to change its background color! well With that stupid mistake behind me. I can finish my game, thank you very much Dave.
Boggahutt87
Click here to download my game (will be there in 2-3 days)
|
|
|
|
|
Hey,
Does anyone know if or how to go about generating a barcode to print out to be scanned by a scanner for tracking purpases. I want to be able to print a barcode onto an order information sheet, but can't seem to figure out how to go about it. If someone could help me on this I'd really appreciate it.
Thanks
|
|
|
|
|
First, you have to know what format of barcode you want to print out. No, they are not all of the same. Are you looking at '2of5', '3of9', 'Code128', ...
There are articles here on CodeProject, all you have to do is search the articles for 'barcode'.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok I'm Still tweaking my game, Fixing up this and that, adding Beeps here and there, Also im trying to add a Transparency with Paintpicture command. What happens is it gives me the ridiculous error of "invalid picture." How is a Picture invalid? I tryed the same code in a blank project and it works. but when there is tiles, it does not work at all. Can someone explain to me what Error 481 is and how i could get around this?
Thanks Alot
Boggahutt87
|
|
|
|
|
There isn't much we can do unless you supply the code that is failing. What type of picture are you trying to paint (.GIF, .JPG, .BMP)? What the controls are that are involved, like PictureBox, ImageList, ... The ridiculous little error CAN occur because there are controls and methods that don't support transparency...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a direct speech control named tts.
I can get the voices and select one of them
but I cannot here the voice. All the time the default one
¿any help for Visual basic .net?
For ing As Integer = 1 To tts.CountEngines
Combo1.Items.Add(tts.ModeName(ing))
Next
' I select Adult Female #1, American English (TruVoice)
Combo1.SelectedIndex = 8
Combo1.Text = Combo1.SelectedItem
' what else to get the voice speaking the following?
tts.Speak("hello")
|
|
|
|
|
Where did this TTS control come from? Was it from the Speech .NET Beta SDK's? Was it the Speech Application SDK? What version are you using? What version of the .NET Framework are you using?
Without knowing this, it's impossible to tell you what's going wrong...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have the Speech SDK 5.1 and I suppose this control comes with this because when I download it over the form, the name is:
in the forms controls:TextToSpeech Class
and when dropped over the form, the name is
AxTexToSpeech1 AxHTTSLib.AxTextToSpeech
Thanks
|
|
|
|
|
That thing is 3 years old! Speech SDK 5.1 was replaced by the Speech Application SDK and soon to be released Speech.NET.
I don't have any idea what the problem could be. As far as I can remember, and find, the 5.1 SDK came with 2 voices, 1 Male and 1 Female.
From the object names that you've given, your using the ActiveX control version of the TTS engine. You might want to go back to the samples and try the methods spelled out in there so you don't have to use the ActiveX version.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks.I was my first approach to TTS so I went into microsoft web and download what I thought was up to date. I will wait for Speech.Net to start my approach to TTS.
Thanks a lot.
|
|
|
|
|
(as marisolera)
I found the answer.As I have only the visual basic .net for students and not the full visual studio, I cannot implement other speech programs than Speech SDK 5.1. This program comes with 4 voices (Mike,Sam,Mary and a predefined one).
I will use all this four and that's o.k. for the moment, even when my project needs between 20 and 30.
|
|
|
|
|
how can i use API functions and LVM_INSERTITEM to insert items into a listview?
|
|
|
|
|
You would have to use the SendMesage function. You would need the target Listview's window handle (hWnd) and a pointer to a completed LVITEM structure.
But, why would you want to go through that hell when there is a perfectly good Items.Add function?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ok...
Public Declare Auto Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As IntPtr, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As LVITEM) As Long
Public Structure LVITEM
Dim mask As Long
Dim iItem As Long
Dim iSubItem As Long
Dim State As Long
Dim stateMask As Long
Dim pszText As String
Dim cchTextMax As Long
Dim iImage As Long
Dim lParam As Long
Dim iIndent As Long
Dim iGroupId As Long
Dim cColumns As Long
Dim puColumns As Long
End Structure
Public Const LVIF_TEXT = &H1
Public Const LVIF_IMAGE = &H2
Public Const LVIF_PARAM = &H4
Public Const LVIF_STATE = &H8
Public Const LVIF_INDENT = &H10
Public Const LVIF_GROUPID = &H100
Public Const LVIF_COLUMNS = &H200
Public Const LVM_FIRST = &H1000&
Public Const LVM_INSERTITEMA = (LVM_FIRST + 7)
Public Const LVM_INSERTITEM = LVM_INSERTITEMA
Public Const LVM_GETITEMCOUNT = (LVM_FIRST + 4)
Private Sub fAddItem(ByVal sText As String, Optional ByVal lIndex As Long = 1, Optional ByVal iIcon As Long = -1, Optional ByVal iIndent As Long = 0, Optional ByVal lItemData As Long = 0)
Dim tLV As LVITEM
Dim lR As Long
tLV.pszText = sText & vbNullChar
tLV.cchTextMax = Len(sText) + 1
tLV.iImage = iIcon
tLV.iIndent = iIndent
tLV.lParam = lItemData
tLV.iItem = lIndex - 1
tLV.mask = LVIF_TEXT Or LVIF_IMAGE Or LVIF_PARAM Or LVIF_INDENT
lR = SendMessage(Me.ListView1.Handle, LVM_INSERTITEM, 0&, tLV)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call fAddItem("test")
End Sub
what is wrong?
|
|
|
|
|
For one, your using VB.NET and passing Long's for your parameters. Use Integers instead. VB6 passed Long's because they are 32-bit integer's. In VB.NET, they are 64-bit. Next, declare your structure with a Sequential Layout. This will make sure that all of your structure members appear in memory in the order that you specified them. Lastly, don't do this on a Form_Load event. It is not guaranteed that your ListView will even have a handle until after Form_Load is complete. Test it in a button click event.
Public Declare Auto Function SendMessage Lib "user32" Alias "SendMessageA" ( _
ByVal hwnd As IntPtr, ByVal wMsg As Integer, _
ByVal wParam As Integer, ByRef lParam As LVITEM) As Integer
<StructLayout(LayoutKind.Sequential, CharSet := CharSet.Ansi)> _
Public Structure LVITEM
Public mask As Integer
Public iItem As Integer
Public iSubItem As Integer
Public State As Integer
Public stateMask As Integer
Public pszText As String
Public cchTextMax As Integer
Public iImage As Integer
Public lParam As Integer
Public iIndent As Integer
Public iGroupId As Integer
Public cColumns As Integer
Public puColumns As Integer
End Structure
Public Const LVIF_TEXT = &H1
Public Const LVIF_IMAGE = &H2
Public Const LVIF_PARAM = &H4
Public Const LVIF_STATE = &H8
Public Const LVIF_INDENT = &H10
Public Const LVIF_GROUPID = &H100
Public Const LVIF_COLUMNS = &H200
Public Const LVM_FIRST = &H1000&
Public Const LVM_INSERTITEMA = (LVM_FIRST + 7)
Public Const LVM_INSERTITEM = LVM_INSERTITEMA
Public Const LVM_GETITEMCOUNT = (LVM_FIRST + 4)
Private Sub fAddItem(ByVal sText As String, Optional ByVal lIndex As Integer = 1, _
Optional ByVal iIcon As Integer = -1, Optional ByVal iIndent As Integer = 0, _
Optional ByVal lItemData As Integer = 0)
Dim tLV As LVITEM
Dim lR As Integer
tLV.pszText = sText & vbNullChar
tLV.cchTextMax = Len(sText) + 1
tLV.iImage = iIcon
tLV.iIndent = iIndent
tLV.lParam = lItemData
tLV.iItem = lIndex - 1
tLV.mask = LVIF_TEXT Or LVIF_IMAGE Or LVIF_PARAM Or LVIF_INDENT
lR = SendMessage(Me.ListView1.Handle, LVM_INSERTITEM, 0&, tLV)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button1.Click
fAddItem("test")
End Sub
Also, I have NOT tested this code. I've just corrected the obvious mistakes and reposted the code. I haven't run it through the compiler or tried to run it!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Hi
My question is:
can i make a dialog (form) with tabs using Vb and use this dialog in a web page, or should it be developed using asp or asp.net?
if it possible than how can i do it!
|
|
|
|
|
You could create the whole thing as a big ActiveX control, and then embed that in the page....
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
I have an access table that has a query to make a fullname from one column-(Lastname) and another column-(Firstname). The query puts the Lastname and firstname like this:
Lastname, Firstname
The problem is that when I go to setup the adapter in VB .NET the table doesn't show this column in the list, so I'm at a loss on what to try next. Everytime I try different things with no success. If someone can help me I'd appreciate it.
|
|
|
|
|
I have an access table that has a query to make a fullname from one column-(Lastname) and another column-(Firstname). The query puts the Lastname and firstname like this:
Lastname, Firstname
The problem is that when I go to setup the adapter in VB .NET the table doesn't show this column in the list, so I'm at a loss on what to try next. Everytime I try different things with no success. If someone can help me I'd appreciate it.
|
|
|
|
|
Hi there. If you are basing your SelectCommand sql statement in your DataAdapter on the table, it wouldn't include any query-based computed fields. Can you base your SelectCommand statement on the query instead? I think you would simply use the query name in place of the table name.
|
|
|
|
|
Thanks,
About five minutes after I sent posted that message, I tried that and it has worked so far. I'm going to continue testing it though. Thanks for your help.;)
|
|
|
|