• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

simple vb question

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    simple vb question

    OK - I have installed this MS VS thing and I am having a look at ms development starting with vb (dont let any of my friends know) initially with a simple win32 application.

    I want to have a settings form which holds the options. So I have my two forms - main form with a menu, second form with the options on it.

    I want to create the settings form the first time that 'options' is clicked from the menu, then use hide() and showDialog() so that I dont get multiple instances. I dont seem to be able to check that an object exists or compare it to null to know if the form has already been instatiated. Can that possibly be right ? What have I not understood ?


    As a second Q - does the visual designer bit work for C++ ? Because I cannot get it do do more that trivial stuff - cannot define contents of a list box for example in designer. Do you all just use it to set up the basic app and then hand code everything else ?


    Thanks

    Mark

    #2
    Hmm... I don't know how you look whether something exists, but what you can do, is simply create your user interfaces on startup, then you know they exist, and just show them as and when.

    Comment


      #3
      Use something like:

      Set frmSettingsInst = New frmSettings

      and then you'll have a reference to the form you can use anytime.

      If you want to be fancy and make it modal (without using the CommonDialog control) then use the Windows API SetWindowPOS - works a treat and I'm sure there are plenty of examples on the web.

      Comment


        #4
        OK

        Fair enough,

        vb doesnt handle what I want ( I can feel better about all those years slagging it off) - I was hoping for a general solution, I can think of lots of cases where I would want to do similar things which depend on the state of a structure. I might do it by creating an array and check the array to see if instantiation has occured and proceed accordingly. I suppose you cant do pointers to functions either ?

        What do you do if you have an app with lots of forms - just gobble memory setting them all up at the begining ?

        thanks anyway

        Comment

        Working...
        X