Window's Vista Controls

B

BrianTa

Hi,

I have VS2005 running on Windows Vista, and all seems to operate just fine -
except the app I have created uses a scrollbar control added to a panel
control. It operates correctly, but does not have the "look" of a Vista
scrollbar. The RichTextBox I am using has Vista looking scrollbars, though
(hence they don't match). Can someone tell me what I need to do to make them
match (at least - and preferably to look like Vista SB's). I am currently
running (at least before the upgrade to Vista) .Net 2.0. I don't know if I
need to add an extension to VS2005 or .....?

Thanks in advance!
-Brian
 
B

BrianTa

Hi Robin,

Then app is written in C#. And, to the best of my knowledge, I am doing
nothing special to sway the appearance from one style to the next. I have
looked at the settings (and will relook again) - but I don't think I am
doing anything style specific. There are a couple of odd things here. One
is that the scrollbar looks like it is supposed to under the designer. And
two, if I create a simple app (panel control with a vscrollbar beside it)
then the scrollbar looks as it should. All this seems to tell me that I
have something (though I don't know what) set awry.

-Brian
 
B

BrianTa

Just one extra bit of added info - it appears that any older pre-Vista
projects that I have, have this issue - and it's not just with the
scrollbars, it's with buttons (etc) as well - they show up great in design
mode, but look like the older style buttons upon execution.
 
R

RobinS

In VB, there is an option on the project properties screen that allows you
to enable the XP Visual Styles. I believe in C#, you have to do this in the
Main program where you start up your application.

I think it's something like Application.EnableVisualStyles. You can use the
ObjectBrowser to check for sure.

My theory would be if you enable it, it will fix your Vista-display
problem. My guess would be it doesn't mean XP per se, but XP versus
Windows2000 or WindowsNT style, so if you upgraded to Vista, I'd think it
would tell whether to show the controls in the newest style, i.e. Vista.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
 
B

BrianTa

You're a genius! That took care of the issue.

The calls to...

Application.EnableVisualStyles(); // and
Application.SetCompatibleTextRenderingDefault(false);

....are being generated at initial program creation . All my new projects
have this added - the old ones don't.
I don't know how I missed it.... but glad you caught it.

Thanks again,
-Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top