1 Attachment(s)
Just thought I'd show off my prog :-)
Basically it is simple "operating system" emulation...windows are done using frames, and they can be resized, dragged/moved, minimised and closed...for the filesize, I think it's pretty good. The actual VB code is about 15k...and 12k of that is in the form.
Thanks to BushMobile, brucevde and WestConn1 for their help with certain aspects of this...I'm still new to certain parts of VB :-)
Feel free to use the code within your own programs, it's basically out there already but I just put it all together into this...the program (as a whole) is copyrighted to me, but as long as you don't just steal the whole thing and pretend it's yours I don't mind :-)
There *ARE* bugs in the code (try resizing a window to nothing), but this is only an early preview and about 2 or 3 days lazy work :-)
Re: Just thought I'd show off my prog :-)
can u post screens for those of us who just want to look, not touch?
Re: Just thought I'd show off my prog :-)
Quote:
Originally Posted by d00by
can u post screens for those of us who just want to look, not touch?
http://i10.photobucket.com/albums/a117/SmUX/POS.gif
Of course, most of the fun of the program is actually running it...it's what you can do with the windows (like resize, minimise, drag etc)...just seeing it isn't enough :-)
Re: Just thought I'd show off my prog :-)
I removed the executable from your zip. ;)
Re: Just thought I'd show off my prog :-)
Looks good. :thumb:
If you don't mind, I have a few suggesations. :)
1.) Option Explicit missing.
I know you don't like to use it, but many of us don't like to see a code without these 2 words. ;)
2.) Don't use End. Before terminating your app, always close all open objects and forms.
3.) While dragging the label, the frame flickers. See if something similar to this gives you any idea.
Re: Just thought I'd show off my prog :-)
1) Yeah, I forgot what the code was as I never used it...I *wanted* to add it...I'll edit and re-upload (without EXE as you don't like them, RobDog :-))
2) Should be simple enough to use the "for each" to unload everything loaded before unloading the form
3) I don't really understand the code you linked to...don't know what it does or anything...so I'll leave it for now :-)
Re: Just thought I'd show off my prog :-)
Added the Option Explicit (although I didn't need to make any changes once I added that line...which totally baffles me...normally I need to add tons of dims :-))...also modified the close so that it now unloads all the loaded elements (on loading them, I add "gen" to the tag for the item so I know it was generated after runtime, and I just unload everything that has gen as the tag) and I have also made one other change...
...now clicking the menu either shows or brings the window to the front...before it would show or hide the window...this is more realistic :-)
My next step will be to add in lots of comments in the code so people know what it is doing :afrog:
Re: Just thought I'd show off my prog :-)
1.) Your Form is still missing Option Explicit. Add it and press Ctrl+F5 (start with full compile). ;)
(To autometically add Option Explicit when you open a new code window, go to,
Tools>Options menu, and check "Require variable declaration" checkbox.)
2.) For this app, this will be enough,
VB Code:
Private Sub cmdExit_Click()
Unload Me
End Sub
Re: Just thought I'd show off my prog :-)
Quote:
Originally Posted by iPrank
1.) Your Form is still missing Option Explicit. Add it and press Ctrl+F5 (start with full compile). ;)
I added it to the module...I thought that made it global...but I'll do that now and make the changes and upload again (and delete the previous uploads)
Quote:
Originally Posted by iPrank
2.) For this app, this will be enough,
VB Code:
Private Sub cmdExit_Click()
Unload Me
End Sub
YOU said "Before terminating your app, always close all open objects and forms." :-P
I'll leave it in there for now...it might be important later on if I add extra stuff later on (which I plan to...this is the building blocks for a game I plan to make :-))
EDIT: I have removed all attachments and re-uploaded it to the *first* original post...so go there to get it...option explicit is in there and I've left the full unload code in there as it's cleaner IMO :-)
Re: Just thought I'd show off my prog :-)
Quote:
Originally Posted by smUX
YOU said "Before terminating your app, always close all open objects and forms." :-P
Objects = any database connections/Class objects/object created by CreateObject() etc.
Forms = Forms
I didn't say "Controls". :D
All controls autometically get unloaded when their container unloads.
Re: Just thought I'd show off my prog :-)
True...I think of a control as an object though...guess it will be better without the unload bit then...reduces the filesize a little too, so I am happy.
Not bothering to upload it all again though...not yet...I'll comment the code a little first and upload an updated version tomorrow perhaps :-)
Re: Just thought I'd show off my prog :-)
You have declared all variables as Single. But there is no need to. This only makes your app slower. Make them Long.
Re: Just thought I'd show off my prog :-)
Made the changes (not uploading yet...tomorrow when I've commented) and I am also going to try putting the drag bar outside the frame to stop it from flickering...it should be simple enough to make the changes