Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

VB6 Help

  1. Dec 18, 2008 #1


    User Avatar
    Gold Member

    I made a simple lock program which is always ontop of other programs, I've removed all the controls from the form such as the cross button, it can only be closed by entering a password. The form can still be resized though so people can still use the computer. To get around this I tryed using the scalewidth and scalehigh options to resize it to full screen.

    Code (Text):
    form1.scalewith = 11400
    form1.scalehight = 15000
    This is in a timer as a simple way rather than check it has been resized by the user. I can't get thecode to work though, even in something like a command button.

    Can anyone work out where I'm going wrong?

    thanks :biggrin:
  2. jcsd
  3. Dec 26, 2008 #2


    User Avatar
    Science Advisor

    Just load the form with the vbModal keyword:

    Code (Text):

    form1.Show vbModal
    Then change the form properties as follows:

    Code (Text):

    BorderSytle = Fixed Dialog
    ControlBox = False
    Moveable = False
    This will create a pop-up form that will prevent them from doing anything until they enter the correct password. Of course the code for the correct password should unload the form as well as do whatever else you want it to.

    Hope this helps.

  4. Dec 30, 2008 #3
    so your saying that the program wont even shut down with the task manager or with
    alt + f4?
  5. Dec 30, 2008 #4


    User Avatar
    Science Advisor

    No, I'm not. Perhaps I misread the OP's question. I assumed he meant all windows inside the VB application and not all windows (or applications) in the OS.

  6. Dec 30, 2008 #5
    ive no idea what he meant now lol, but I guess he'll be the decider when he posts again.
  7. Dec 31, 2008 #6
    1st: madmike, why are you still using VB6?

    2nd: stewartcs showed the solution. btw, to prevent Alt+F4 the KeyDown/KeyUp events should have an handler that cancels it. For the Ctrl+Alt+Del there's nothing you can do, unless you make your program a system service (Win 2k and above).
  8. Jan 6, 2009 #7


    User Avatar
    Gold Member

    as edsousa suggests, maybe it's time to move on from VB6. VB.NET is a lot nicer these days.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?

Similar Discussions: VB6 Help
  1. Splitting String-VB6 (Replies: 1)

  2. VB6 Help out of stack (Replies: 2)

  3. DE0 help (Replies: 7)