adr990 Posted May 29, 2011 Author Share Posted May 29, 2011 Hello everyone,I wanted to add a delay on login, to avoid kind of problems you could possibly have if there wasn't a delay. :PThere probably are like almost none, but just in case.Well here is the code:Make a picturebox in frmMenu (I have it all over the Menu).Name the picture box "delaypic", and set it to False.Find "If isLoginLegal(txtLUser.text, txtLPass.text) Then", under "Private Sub lblLAccept_Click()", in frmMenu.Replace everything under it with:``` MsgBox "Please wait a while, until the Delay is over." frmMenu.delaypic.Visible = True frmMenu.delaypic.Picture = LoadPicture(App.Path & "\data files\graphics\load\" & "delay.bmp") Sleep 10000 frmMenu.delaypic.Visible = False Call MenuState(MENU_STATE_LOGIN) End If ' Error handler Exit Suberrorhandler: HandleError "lblLAccept_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub```Ofcourse you can modify it to what every suits you.I've got the idea from Reign of London's Eyecatch Framework.And yes, I know the 'Msgbox' probably could be like a GUI pop up, I probably will update the tutorial for that later.~Adr990 Link to comment Share on other sites More sharing options...
Carim123 Posted May 29, 2011 Share Posted May 29, 2011 @adr990:> frmMenu.delaypic.Picture = LoadPicture(App.Path & "\data files\graphics\load\" & "delay.bmp")If it's only loading one image, shouldn't you just hard-code it, with the properties?Still, it's a cool and simple addition, that can have a good use. Link to comment Share on other sites More sharing options...
adr990 Posted May 29, 2011 Author Share Posted May 29, 2011 Yes but, I like to have such things being easily editable for the person who will be doing the GUI's. ehOh, also, the picturebox should be set to False. Forgot to mention that. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now