Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: need help in VB.Net

  1. #1
    Join Date
    Jun 2005
    Posts
    51
    Rep Power
    0

    Question need help in VB.Net

    I am trying to teach myself vb.net, i have some questions. can anyone help me
    Firstly, does anyone have any links to good Vb.Net tutorials online? i found some site wha nuh mek nuh sense

    Secondly, how do you use a main form to open a sub-form?

    Thirdly, how do i exit a form e.g when i press a cancel button on a form. i tried Onload(), unload me, exit sub. none of them worked

    Please and Thanks in advance

  2. #2
    Join Date
    Nov 2004
    Posts
    42
    Rep Power
    0

    Default

    Firstly the best tutorial you can find on the net about VB.Net is the MSDN Library, everything you read on the net will send you straight back to MSDN library. two other good place to start is the Microsoft visual studio .net documentation or Microsoft .NET Framework SDK documentation, these files usually come with setup program and can be access from the start menu or via the folder on your computer where you load visual studio.

    Secondly: not sure if you are using MDI child form. However to open a Form from another Form you have to create an instance of the form you want to open and use that instance to open the form.

    E.g

    Say you have a form name FrmyourName.
    To open this form from another form (in a click event, such as button or menu item) create a instance of the form like this:
    dim anything = new FrmyourName ()
    anything.show

    whenever you click the button or menu item it will open FrmyourName.

    Thirdly:
    In the cancel button click even: just type the word “End” and that should take care of that.
    Last edited by Ghetto_Nerd; Jul 17, 2005 at 09:54 PM.

  3. #3
    Join Date
    Nov 2002
    Posts
    2,832
    Rep Power
    0

    Default

    One correction, issuing the END statement will end the program completely, I think monitone only wants to unload or close just the form the cancel button is clicked on.

    If I am correct, then unloading the form can be done by either of the two commands below where formName is the instantiated name of your form:

    FormName.Close
    or
    FormName.Dispose


    To load a form
    --------------
    Dim formName as New FrmMain
    FormName.Show


    To close a form
    ---------------
    FormName.Close
    or
    FormName.Dispose
    Device: iPhone® 4S OS: v5
    POWERED By: LIME 3G


  4. #4
    Join Date
    Nov 2004
    Posts
    42
    Rep Power
    0

    Default

    Quote Originally Posted by seanbee20

    To close a form
    ---------------
    FormName.Close
    or
    FormName.Dispose
    You are correct.. However i was thinking that because most forms have the close button on the top right hand corner, where you can just simple close the individual form, i thought he wanted to end the program it self. thanks for the correction.
    Last edited by Ghetto_Nerd; Jul 18, 2005 at 12:44 PM.

  5. #5
    keroed1 Guest

    Default

    ok i know that in vb u can set forum to be fix thus user can resize the window by pressing minimise or maximise because they are not there only the close but is present for them to click can u do that in vb.net

  6. #6
    keroed1 Guest

    Default

    also if i use main form to call a sub form for exampe a sub form that collects a user name and password can it return a value to main form for me to use. if so how
    p.s giva a simple example.

  7. #7
    Join Date
    Nov 2002
    Posts
    2,832
    Rep Power
    0

    Default

    Quote Originally Posted by keroed1
    ok i know that in vb u can set forum to be fix thus user can resize the window by pressing minimise or maximise because they are not there only the close but is present for them to click can u do that in vb.net
    Yes it can, just check the properties section of the form

    Quote Originally Posted by keroed1
    also if i use main form to call a sub form for exampe a sub form that collects a user name and password can it return a value to main form for me to use. if so how
    p.s giva a simple example.
    Simple, just use global variables.

    Example, you can define your variables say in a public module.

    Public username as String
    Public password as String

    in your sub form, you would say
    username = text1.text
    password = text2.text

    So in all your other forms, you can get the value by just referencing the variables username/password.

    Main form.

    Example
    lblstatus.caption = "You are logged in as: " + username
    Device: iPhone® 4S OS: v5
    POWERED By: LIME 3G


  8. #8
    keroed1 Guest

    Default

    @seanbee20
    blessed at wrk right now when i get home i'll try and let u guys know wat is happening
    "Yes it can, just check the properties section of the form"
    can tell me directly under what field name should i look for that option

  9. #9
    Join Date
    Nov 2002
    Posts
    2,832
    Rep Power
    0

    Default

    Quote Originally Posted by keroed1
    @seanbee20
    blessed at wrk right now when i get home i'll try and let u guys know wat is happening

    can tell me directly under what field name should i look for that option
    Click on the form, go to the properties pages and look for two properties (minimizebox and maximizebox), set both of them to false to disable them
    Device: iPhone® 4S OS: v5
    POWERED By: LIME 3G


  10. #10
    keroed1 Guest

    Default

    Quote Originally Posted by seanbee20
    Click on the form, go to the properties pages and look for two properties (minimizebox and maximizebox), set both of them to false to disable them
    not sure if is my verision nothing is there for maximise and minimise

    next question right the sub_form.close worked

    i had set the main_form to invisible because when i am seeing the sub form i dont want to see the main form but when i am finish with sub form i want to se it again is there a way i can make it visible again i tried to institate main one and call it just like i did the sub form but that does'nt wrk

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •