Closing Forms on Other Form Load menu

Shout-Out

User Tag List

Results 1 to 10 of 10
  1. #1
    1ns0mnia's Avatar Active Member
    Reputation
    67
    Join Date
    Nov 2007
    Posts
    428
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Closing Forms on Other Form Load

    ok so ive been messing about with VB for a while and im starting to get into it, but ive faced myself with a problem. ive made a starter page for my program using a different form (form 4)

    now on form 4 i want it so you click continue, and it closes the form 4 and loads form 1 (the main program)

    ive tried many ways of doing this, such as:
    Dim FirstForm as new Form1
    Dim FourthForm as new Form 4

    FirstForm.Show()
    FourthForm.Close() ~~ ive also tried Me.Close and Close() ad this is on form 4.

    ive tried to exit form 4 on load of form 1
    bascially ive tried everything that could possibly do it, but i seem to me missing somthing, ive looked at other scripts and they just seem to be what ive done yet mine are still failing. any ideas?

    thanks in advance
    insomnia

    Sorry for the spelling mistakes XD

    Closing Forms on Other Form Load
  2. #2
    Mitron's Avatar Contributor
    Reputation
    127
    Join Date
    Jun 2008
    Posts
    1,326
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is it VB 2008 ?? if it is just use Me.Hide
    (think it works for other VB versions too)

    ----------------------------------------------------------------

  3. #3
    1ns0mnia's Avatar Active Member
    Reputation
    67
    Join Date
    Nov 2007
    Posts
    428
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you dont understand how much i love you

    days and days of tedious searching and its somthing simple like that

    thankies
    Last edited by 1ns0mnia; 05-30-2009 at 07:50 PM.

  4. #4
    Mitron's Avatar Contributor
    Reputation
    127
    Join Date
    Jun 2008
    Posts
    1,326
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hehe think bout this... Form1 is the base that keeps the whole app running :P how can other parts of the app run if the base is turned off ?? just hide it somewhere you cant see it simple ^^ sometimes VB is just too logical

    ----------------------------------------------------------------

  5. #5
    1ns0mnia's Avatar Active Member
    Reputation
    67
    Join Date
    Nov 2007
    Posts
    428
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i was wondering, instead of making a new thread id post here but

    say if i have 3 text boxes all with text in them

    how would i make the program type what would be in 1 of the text boxer? asin choose one of the 3 at random? and on a timer

    im presuming this will need the timer, the appactivate (i can do these 2)
    but for the SendKeys.Send("") what would i hate to put so it only chooses one at random?

  6. #6
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mitron, not always form1. You can also set a Subroutine in a module as the main bit, a different form...

    1ns0mnia, you already know how to use the timer, appactivate and sendkeys.send, so all you need is the random number, right?
    Code:
    Dim rand as Integer
    rand = Int(rnd*3) + 1
    gives a random integer from 1 to 3. Int cuts off the decimal, rnd gives a pseudo random number (based off the current time) which is between 0 and 1, multiplying by 3 means the Int(rnd*3) part can be 0, 1 or 2, and adding the one gives the possible answers being 1, 2 and 3.

    Description because it's better to teach than to spoonfeed.

  7. #7
    1ns0mnia's Avatar Active Member
    Reputation
    67
    Join Date
    Nov 2007
    Posts
    428
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok i understand part of it, the integer part of the code

    but how would i implenet this to get it to pick 1 of the 3 text boxes?

    it might sound like im trying to be spoonfed but im really not, ive tried all i can think to put then

    yeah i suck at VB XD

    basically im wanting it to choose one at random, and send that one through to the SendKeys.Send("")

    thanks in advance
    Insomnia

  8. #8
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, the integer will be random from 1 to 3, right? So put your textboxes in an array (textbox(1), textbox(2), textbox(3)), then Sendkeys.Send(Textbox(rand).Text).

  9. #9
    1ns0mnia's Avatar Active Member
    Reputation
    67
    Join Date
    Nov 2007
    Posts
    428
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ahhh

    thankies

    cant rep you again yet since i did it yesterday, sowwie.

  10. #10
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    S'cool, the important thing is that you've got it working. Give us a yell if need any more help.

Similar Threads

  1. Replies: 9
    Last Post: 08-06-2016, 10:51 AM
  2. [Selling] Strife Closed Beta Keys & Other Games
    By QuickTrader in forum General Trading Buy Sell Trade
    Replies: 2
    Last Post: 05-18-2014, 06:01 PM
  3. Shadowform - Moonkin and other forms (Assist plz)
    By Sofos in forum WoW ME Questions and Requests
    Replies: 6
    Last Post: 05-21-2009, 06:15 AM
All times are GMT -5. The time now is 05:49 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search