|
-
Aug 3rd, 2006, 08:35 AM
#1
Thread Starter
Lively Member
Add menu item to system menu of excel imported form [SOLVED]
I'm trying to achieve above 2 items but can't find out how. I've searched this forum already but also can't find anything relevant so am hoping that some of you might be able to kick me in the right direction.
I'm creating a combined VB6 and excel application. Basically VB6 controls excel. The forms used are imports from existing excel applications where I didn't feel like recreating them all over again. Part from that, the excel tab control is way better and easier to use then the VB6 one.
Progress timer:
When starting the program I want to show a progress timer because the program needs to initialize many items and arrays used. I thus created a simple progress timer which depending makes certain pictures visible which form a simple progress bar. The timer used is the VB6 timer option since there's nothing relevant like that from excel. This works well in itself but the problem is with display of the timer. During start it shows the form on which it was created but the timer only starts working after all has been initialized which basically defeats its purpose. Does anybody have any idea how to conquer this one.
Add item to top left window menu:
I want to add a About option to the top / left menu of my program window, the one also containing the minimize and maximize options. I've seen it done in other programs and since it is the only menu item I need I would prefer to do it this way also. I can't however find any information on how to go about this. Hope that someone can give me a push in the right direction for this one as well.
Thanks in advance for any suggestions.
Best regards,
Leon
Last edited by Hack; Aug 8th, 2006 at 09:38 AM.
Reason: Added green "resolved" checkmark Last edited by droopy928gt : Today at 10:01 AM.
-
Aug 3rd, 2006, 11:06 AM
#2
Re: Progress timer during startup and add menu item to top/left window menu
Just a question... what do you mean by "display of the timer"? If it starts working only after the initialization is completed, put the initialize code into Timer1_Timer() procedure. Don't quite understand you... as for the second question... I didn't understand that as well... you wan't to create a menu or what? If so, go to the Menu editor (3rd icon in a default VB's toolbar).
-
Aug 3rd, 2006, 11:22 AM
#3
Thread Starter
Lively Member
Re: Progress timer during startup and add menu item to top/left window menu
Hi gavio,
To clarify.
I meant to display the progress bar controlled by the timer. Every time the timer code is run another part of the progress bar is made visible, hence creating the idea of progress. During startup the form containing the progress bar is displayed but the timer only starts running after the programs initialization is completed, thus surpassing the whole idea of a progress bar.
As for the menu. Every window has a top / left menu containing amongst others the minimize and maximize options. I want to add an option there of myself with which I want to show the "About" form for the program.
Best regards,
Leon
-
Aug 5th, 2006, 02:13 AM
#4
Thread Starter
Lively Member
Re: Progress timer during startup and add menu item to top/left window menu
Anybody, or are the questions I asked this difficult or this dumm?
Best regards,
Leon
-
Aug 5th, 2006, 02:21 AM
#5
Re: Progress timer during startup and add menu item to top/left window menu
The usual way to do it would be to create a separate form (splash screen) which contains your timer and progress bar. This form calls your initialization code and when the initialization is finished, the splash screen is unloaded.
EDIT: To add an item to the system menu check this link....
http://vbnet.mvps.org/index.html?cod...ystemabout.htm
Last edited by pnish; Aug 5th, 2006 at 02:29 AM.
Pete
No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.
-
Aug 5th, 2006, 03:34 AM
#6
Thread Starter
Lively Member
Re: Progress timer during startup and add menu item to top/left window menu
Hi pnish,
Many thanks for your answers. Not just the systemabout but also the site its on. Didn't know that site yet and by the looks of it it contains loads and loads of interesting stuff to read.
As for the progress bar, you're suggestion is the way I also tried. I think my problem though comes from it being a combined VB6 and Excell form program which is something I haven't been able to solve to date.
I have 1 VB6 form and 1 imported excel VBA form with all me controls. This is done because I used the multipage control for which there is no workable alternative in VB6, in addition with excel comboboxes and listboxes it is possible to assign arrays to them which is also not possible with VB6. This apart from me being lazy and not wanting to recreate everything all over again in VB6.
The VB6 form contains the progressbar and timer control. The VB6 form upon running displays itself, starts the timer and then shows the excel form. Showing the excel form starts its code and begins initializing the program. At that point I want the VB6 form progress bar to run which would be disabled after the excel form code finished initializing.
The problem is that the progress bar only starts working after the excel code has finished surpassing the whole idea of showing progress.
I tried many combination of just showing, or showing using vbModeless or vbModal to no avail.
Hope anyone can shed some light on this.
Thanks and best regards,
Leon
PS:
Just found an example of splashscreen on the site you quoted as well. Gonna have a good look at it.
Last edited by droopy928gt; Aug 5th, 2006 at 03:40 AM.
-
Aug 8th, 2006, 04:41 AM
#7
Thread Starter
Lively Member
Add menu item to top/left window menu
Hello Pnish,
I've been playing around with the example link for an about entry in the system menu. If I use the example in VB6 it all works well. When using it with a imported excel form it all goes down the toilet. VB6 hangs without the chance of recovery.
It all goes wrong in the sub HookWindow with the statement
VB Code:
Call SetWindowLong(hWnd, GWL_WNDPROC, AddressOf HookFunc)
VB6 simply hangs after which I need to terminate it using the taskmanager.
As added explanation, imported excel forms do not have the load and unload events and as such for testing I put those in 2 command buttons.
Hope that someone can help me with this as I simply do not have sufficient knowledge to solve this one. Thus a kick in the right direction would be appreciated.
Thanks and best regards,
Leon v/d Willik
-
Aug 8th, 2006, 09:00 AM
#8
Thread Starter
Lively Member
Re: Add menu item to system menu of excel imported form
Never mind, think I've found it already. It seems that the _load code can not be put in a command button. I've now put it in the VBA equivalent, being _Initialize and that seemed to do the trick. At least it worked on a quick and dirty test project. Have to see if it does in the final program.
These combined VB6 / VBA projects can sure cause a lot of headaches.
Best regards,
Leon
-
Aug 8th, 2006, 02:13 PM
#9
Re: Add menu item to system menu of excel imported form [SOLVED]
In VBA there is no userform_load or such. Only userform_initialize. Its the same event generally. If you need an event that fires when the workbook opens there is always the workbook_open event.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|