Search:

Type: Posts; User: henzino2

Page 1 of 2 1 2

Search: Search took 0.04 seconds.

  1. Re: small calculation problem - do such and such if number1 and number2 are not integ

    Try converting the number to a integer, and see if it changes:

    If Int(yournumber) = yournumber then
    Msgbox "The number is a integer"
    Else
    Msgbox "The number has decimals"
    End If
  2. Replies
    6
    Views
    9,839

    Re: Editing a text file in VB6

    Ah, I read it through one more time and I think I got it wrong... You just want the last line of text in the textfile, right? Then:

    Dim strListitems As String
    txtEdit.Text = vbnullstring
    Open...
  3. Replies
    6
    Views
    9,839

    Re: Editing a text file in VB6

    Your code for writing the file seems good, just add the "Close FF" at the end:


    Dim FF As Long
    Dim FilePath As String

    FF = FreeFile()
    FilePath = "C:\Output.txt"
    Open FilePath For Output As...
  4. Replies
    1
    Views
    751

    Re: Sleep function in a module?

    Sry, I found it out myself! It has to be "sub" and not "function". sorry! :$

    Resolved!
  5. Replies
    1
    Views
    751

    [RESOLVED] Sleep function in a module?

    Hi everyone,
    I'm trying to write a function that uses the "Sleep" command, but when I call the function VB crashes (it stops responding)! My code looks like this:


    Option Explicit

    Declare...
  6. Re: Connecting computers using Winsock behind a router

    OH YES! THANK YOU ALOT DIGIREV! That DMZ hosting thing works, everything works now! :D:D:D:D

    One more thing, you mentioned something about uPnP, how do I use that? Because I doubt that my friends,...
  7. Re: Connecting computers using Winsock behind a router

    I have the same problem as cyber_alex, and I've tried everything, it still doesn't work. The application still shows my local IP, and my computer is still unconnectable through my external IP. The...
  8. Re: Compare two text box strings as Simple and Complex

    About the problem you mentioned earlier, when one text has more words than the other, I haven't come up with something good. I've thought of taking each word in A(), and then compare that word with...
  9. Re: Compare two text box strings as Simple and Complex

    To do that you'll just use the split commando again, but instead of " " you write vbnewline:
    Dim LinesA() As String
    LinesA() = Split(Text1.Text, vbnewline)
    You'll get three items in the array...
  10. Re: Compare two text box strings as Simple and Complex

    Hm, this was a hard one, I don't have time to solve it now, but I'll (hopefully) come up with a good solution tomorrow, or else the other more experienced guys here will help you ^^
  11. Replies
    10
    Views
    815

    Re: [RESOLVED] Really dumb VBcode box!

    Okay, thank you all ^^
  12. Re: Compare two text box strings as Simple and Complex

    Just add a Listbox, and then replace the MsgBox line with: List1.Additem A(temp) & " " & B(temp)
  13. Replies
    19
    Views
    1,820

    Re: [RESOLVED] playing a sound file

    Haha, this reminds me of one time when I misplaced a function in the label_click event instead of the label_change... I sat there for like, 8 hours and was ready to kill my computer before i realized...
  14. Replies
    19
    Views
    1,820

    Re: playing a sound file

    You sure the Windows Media Player doesn't work?

    wmp.settings.autoStart = True
    wmp.URL = "blablabla.mp3"
    'the sound will start playing immeadiatly as you have autostart on...

    'some additional...
  15. Replies
    10
    Views
    815

    Re: Really dumb VBcode box!

    Okay, It's really a pity that those old [VBCODE] tags disappeared...
    And I don't really want to use MartinLiss's Cpoy/Paste add-in as I hate having unnessesary processes running in the...
  16. Re: Compare two text box strings as Simple and Complex

    Hm, the first thing I'm thinking of is the "Split" function.. something like:


    Dim A() As String
    Dim B() As String
    A() = Split(Text1.Text, " ")
    B() = Split(Text2.Text, " ")

    Dim Temp As...
  17. Thread: Converter

    by henzino2
    Replies
    12
    Views
    887

    Re: Converter

    Okay..... Then just do it by conditional statement?
    Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyB Then Text2.Text = Text2.Text & "q"
    End Sub

    And then...
  18. Replies
    10
    Views
    815

    [RESOLVED] Really dumb VBcode box!

    Hi,
    I'm getting very irritated at the VBcode box in this forum.
    Let's say I have a box like this with some random code:

    Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
    Dim...
  19. Thread: Converter

    by henzino2
    Replies
    12
    Views
    887

    Re: Converter

    Ehm.. If i got it right, you want your code to check if the user types in a "b" for example, and then immeadiatly change it to an "q"?

    If that is the case...
    Private Sub Text1_KeyUp(KeyCode As...
  20. Replies
    7
    Views
    843

    Re: Declaring an array

    Thank you all guys, you can always trust vbforums :D, resolved.
  21. Re: how to remove the X on at run time?

    Did you add all the declarations and stuff too to each form? (or public:ed them in a module)
    Private Declare Function RemoveMenu Lib "user32" _
    (ByVal hMenu As Long, ByVal nPosition As...
  22. Replies
    7
    Views
    843

    Re: Declaring an array

    I tried it...
    Public Blablabla() As Boolean

    Then in a command button:
    Blablabla(3) = True

    It gives a "subscript out of range" error.
  23. Re: how to remove the X on at run time?

    You have to add the:
    RemoveMenu GetSystemMenu(Me.hwnd, 0), 6, MF_BYPOSITION
    to every form you have, not just one.
  24. Replies
    7
    Views
    843

    [RESOLVED] Declaring an array

    Hi,
    In my game I have a picture array of bullets, and new bullets are added to the array each time you fire using the "Load MyBullet(X)" command.

    To each Bullet item in the array I want to have a...
  25. Re: Loading Modules at "Design Time"

    I think that GKalman thinks of modules as forms - that VB loads the modules when you start your project just like a form, and is wondering if you could prevent that from happening and "load" the...
  26. Replies
    14
    Views
    5,574

    Re: Error: expected array

    Okay, Let's take it all from scratch just so you understand how to use the function ^^ I'll describe VERY simple.

    1. Start Visual Basic, click New - Standard EXE.
    2. Add the module I attached...
  27. Replies
    14
    Views
    5,574

    Re: Error: expected array

    Are you talking about the code example? Because thats meant to be in a command button in a FORM ^^"
  28. Replies
    14
    Views
    5,574

    Re: Error: expected array

    Here, i downloaded it and just pasted it all into a module. Add the module to your project and it will work.

    Example:


    Private Sub Command1_Click()
    Dim Mystring As String
    Mystring =...
  29. Re: Please try out my Naruto game! [ZIP with SOURCE CODE and EXE]

    Okay ^^
  30. Re: Please try out my Naruto game! [ZIP with SOURCE CODE and EXE]

    ah, yes, thanks for the info, i found a good sample of bitblt and I think I understand ^^

    Sorry to bother you, but while you're at it, could you please give a simple explanation to me what class...
  31. Re: Please try out my Naruto game! [ZIP with SOURCE CODE and EXE]

    Ah yes. the thing is that there are only a limited number of image controls with shuriken sprites xD I'm not really a vb-noob, I know all the basic stuff and how to do simple applications, but when...
  32. Re: Please try out my Naruto game! [ZIP with SOURCE CODE and EXE]

    Just wondering... you surely did unzip the file before pasting it into the folder, did you? :P

    Hm... If you did, try replacing your COMCTL32.OCX in windows\system32 with the newer one i attached...
  33. Replies
    17
    Views
    14,164

    Re: VB: 8 Chess Queens on 1 Chess Board [Source]

    So easy :P It took me one minute to solve, as there cant be more than one queen on each horizontal/vertical row the solution is obvious.

    Very fun little program though! :)
  34. Replies
    6
    Views
    27,586

    Re: Scratching Wavs DJ Turntable Simulation

    Really cool program!
  35. Re: Please try out my Naruto game! [ZIP with SOURCE CODE and EXE]

    Here you go :) Put this file in the same folder as the exe and it should work.
  36. Please try out my Naruto game! [ZIP with SOURCE CODE and EXE]

    Hi,
    A couple of years ago, when I started watching anime (Naruto) i became so obsessed that I started to make a game. However, as my obsession faded, and as the filler episodes took over, my...
  37. Replies
    10
    Views
    7,931

    Re: Caps Lock/Num lock on or off?

    Thank you all guys! I combined all your help into one final solution :cool: (I've given reputation to all of you too ^^)

    (Just posting it if someone's intersted)

    In the module:

    Declare...
  38. Replies
    10
    Views
    7,931

    Re: Caps Lock/Num lock on or off?

    Rhinobull, the result is always 0 no matter if caps lock is on or off... Exept for when I press the Caps Lock-button, the result is then -32676, but that value doesn't change depending on if caps...
  39. Replies
    10
    Views
    7,931

    Re: Caps Lock/Num lock on or off?

    And, by the way, if I only wished to toggle Caps Lock, wouldn't it just be easier to Sendkeys("{CAPSLOCK}")? ...
  40. Replies
    10
    Views
    7,931

    Re: Caps Lock/Num lock on or off?

    Private Sub NTToggleKeyCaps()

    Call keybd_event(vbKeyCapital, _
    MapVirtualKey(vbKeyCapital, 0), _
    KEYEVENTF_EXTENDEDKEY Or 0, 0)

    ...
Results 1 to 40 of 55
Page 1 of 2 1 2



Click Here to Expand Forum to Full Width