Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Couple of Quickies

Status
Not open for further replies.
Aug 17, 2008
28
0
0
Hello again folks.

I've got a couple of quick questions for you:

1. I want to get rid of the icon on my form so that the caption behaves as if there is no icon there. How do I do this?

To elaborate, I created my form, went to the 'Icon' property and hit the 'Delete' key. Now I am left with a white box, which is ruining the look of the form. It is this white box I want to get rid of.

2. How do I get the DriveListBox control to display the names of the drives (example: 'Local Disk (C:)'?

Many thanks! :D
 
1. You could set the border style to 'Fixed Dialog' and then delete the icon again. Of course... this means the user won't be able to maximize, minimize, or change the size of the form. Sometimes this is what you want.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
@ gmmastros

That worked, thanks a lot!

@ Everyone else

I have another problem. I'm trying to get my application to use the Windows XP visual style. I have followed the instructions at this site: - and I am using the '.manifest file in same directory as application' method. However, every time I go to start my application, I hear that infamous Windows Chord, and the app doesn't start.

When I rename the .manifest file, it works fine.

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <assemblyIdentity 
        version="1.0.0.6" 
        processorArchitecture="X86" 
        name="Windows Error Message Creator" 
        type="win32" />
    <description></description>
    <dependency>
        <dependentAssembly>
            <assemblyIdentity 
                type="win32" 
                name="Microsoft.Windows.Common-Controls" 
                version="6.0.0.0" 
                processorArchitecture="X86" 
                publicKeyToken="6595b64144ccf1df" 
                language="*" />
        </dependentAssembly>
    </dependency>
</assembly>

Above is the contents of the .manifest file - it is 724 bytes in size, and 724 can be divided by 4 with no problems. So what's the problem?
 
Did you follow the part about:
Ensuring Your Application Links to ComCtl32.dll

Is your startup object set to 'Sub Main'?

Click Project -> Properties
Look at the startup Object.

If this is a FORM, then you need to call the InitCommonControlsVB function in your Form_Initialize event.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
@ gmmastros

I got it to work. Turns out I didn't read it properly. Typical.

When the app loads you get the main screen. Terminating the program from this screen gives an 'unhandled win32 exception' error. Why does it do this? I'm receiving numerous complaints about it happening in some of my other apps, and I would really like to fix it.
 
I couldn't begin to guess. What code is run after the application ends? Could be lots of code.



-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Code:
    If (MsgBox("End Program?", vbQuestion Or vbYesNo, "Exit") = vbYes) Then
        End
    End If

That's all the code used to terminate the program.
 
You should probably not use End to end the program as that does not give it time to properly unload everything.
 
We've had a number of threads discussing the use (or, better, non-use) of 'End' that provide some additional insight into why End is best avoided. A cunning keyword search should find something (I say cunning because I suspect that simply searching for 'End' may get you rather more hits than you want ...)
 
OK, I'll do that.

All that remains now is how to get a DriveListBox to display 'Local Disk (C:)' instead of 'c:'. I've searched on Google and used the Search facility here - but to no avail.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top