Problem with ssOption control in VB6: Text background color changes from Win 98 to Win XP - vb6

I'm using the ssOption control (Sheridan 3d Option control) in VB6.
In Windows 98 the text area background color is the same color as the background color around the Option Circle, and that color is the default form color. So the Option button appears to be transparent.
There is no Background color property and on Windows XP the background color of the text area is a different color from the background color around the Option circle.
Any ideas as to why this would happen? The control's wrapper is in Threed32.ocx and I have the same version of it in the Windows\system32 directory on both the Win98 and WinXP systems.
Why might it behave differently on 98 vs XP?
Any ideas on a fix?

SSOption sets it background to the Windows Button Face on Windows XP. This the same background you get when you make a new form. You will need to use a frame or another type of enclosure that has a background of button face if you want to use it on a multi-colored form. Otherwise use VB6's Option button.
The advantages of the SSOption is the ability to display it's text in a 3D raised or inset format. This really only works well using the default button face color which is why it is hard coded into the control. It also has better formatting of the text when the option button is to the right of the text.
If you can't use a enclosing frame or panel then you have a tedious alternative. You can make an VB6 option with no text. If you are using the 3D font. Then you can use two labels to achieve the same effect. Make the bottom white (or top depending on raised vs inset) and offset by one pixel or 15 twips.
You can use the ZoomIn tool if you installed VB6 as part of the Visual Studio 6 package to make sure it is right.
If you are using it for the Alignment. Then you can fiddle with the width of the VB6 native option control until it looks right or make the option with no text and use a label.

Threed32.ocx is ancient - it was designed for VB4. I would replace it with the built-in VB6 option control.

Alex is right. Threed32.ocx is old and has a number of problems. It's not supported on Vista, it grabs the focus when it's made visible, it's hard to upgrade to VB.NET - there are more. For my company these are strong enough to outweigh the extra functionality it gives - we're droppping it from all our programs.

Related

Notification area flyout link area

I made a flyout window in the notification area using WinAPI and my goal was to make it similar to the flyout windows that show up when you click some of the icons in the notification area, like the Volume icon.
I already succeeded in making it look and behave similar to the other ones, but there is one thing I can't seem to figure out. The link area of the flyout windows has a darker blueish background and there is a subtle difference in the look between Windows 7 and Windows 8. A picture of it in Windows 7 can be seen here
http://msdn.microsoft.com/en-us/library/windows/desktop/aa511448.aspx#flyouts
I achieved this by painting this link area of my flyout window manually in the right colors (including the gradient at the topmost part of the section) using the WM_PAINT message, but I just feel like it's too much of a hack, especially because it's not affected by changing themes in Windows. For example, if I set the "Windows Classic" theme this area should be grey and not blue.
So, my question is, am I missing something in how this can be achieved without painting the window manually. I noticed that the details pane in Explorer windows in Win 7 has the same look. I've searched quite a bit for answers but I haven't found anything yet. This is my first time doing a GUI using the WinAPI so I have very little experience, and therefore I'm assuming there is something that I just don't know about.
UPDATE:
I did manage to figure out how to draw this area without painting it manually. It can be drawn by using the OpenThemeData and DrawThemeBackground functions
HTHEME aeroTheme = OpenThemeData(hWnd, L"FLYOUT");
DrawThemeBackground(aeroTheme, hdc, FLYOUT_LINKAREA, 0, &rect, &rect);
This obviously only works when themes are enabled, so for non-themed cases I draw a normal rectangle with the appropriate color.
I'm not an expert in WinAPI so I can't offer any advice on achieving the look you want without manual painting.
However, if you're successfully achieving the appearance for a particular color theme, I'd suggest you look at the GetSysColor function and use this when creating your brushes for painting. This should allow you to get the correct colors based on the theme that has been set. More info (including a swatch table) can be found here.
Hope this helps.

VisualStudio 2010: Quickly flip between text editor color schemes? (for LCD vs Projector)

In VS2010, I have a customized text editor color scheme that has a black background and light grey text. This is great for me working by myself on an LCD display. However, often I need to plug in to a projector to display code to a group. The black background color scheme does not work well at all on a projector, so I always want to flip back to basically the "default" color scheme.
The only way I know of to do this right now is to export the VS color settings to a backup file, then revert to defaults. When I am done with my group presentation, I can then re-import the previously exported color settings.
Does anyone know of an easier / less manual way of doing this? Like a plugin that lets you flip between text editor color schemes, or simply a macro to do the manual process above?
I found this writeup on how to make a macro and menu items to quickly export/import the fonts and colors: http://jeffhandley.com/archive/2010/03/09/225.aspx

Aligning text boxes

I'm have some data output text boxes (text boxes with no border and with the same background as the rest of the window) that I'm trying to align with a standard edit control + spin button, to represent a column of numbers, one of which can be edited:
I can manually align these in the Delphi / C++Builder form designer, but when I then view the form on a different version of Windows or at a different DPI, the text is no longer right-justified, presumably because of differences in the spin button spacing, borders, etc.
I can use EM_GETMARGINS to determine the width of the spin button, but how can I determine the size of the edit control's margins and borders? I've tried various combinations of EM_POSFROMCHAR, ClientToScreen, GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CXEDGE), and GetThemeMargins, but so far, I can't find a combination that works and makes sense.
More details:
Environment is Delphi / C++Builder XE2.
The data output controls are TEdits with BorderStyle bsNone.
The edit + spin button is a TJvSpinEdit. From viewing its source, it uses EM_SETMARGINS to allow space for its spin button.
Use the Win32 API GetWindowRect() and GetClientRect() methods. The bordering will be the difference between the two rectangles. That will only give you the bordering, though. There could be extra spacing inside the client area.

Which option controls the color of this text?

I have applied a color theme called Vibrant Ink (or some modification of it), and since I installed Visual Studio 2010 Pro Power Tools all my statement completion boxes are unreadable.
undreadable http://img139.imageshack.us/img139/7876/undreadable.png.
What setting changes the colors of these boxes? Preferrably, I'd like to change the background color to something darker, but if that's not possible at least I want to change the text color.
Update: I changed the SignatureHelpTooltipBackground setting under Tools->Options...->Environment->Fonts and colors, but this doesn't seem to affect the tooltips when editing JavaScript.
Is there another setting for JS colors, or is this a bug in VS?
The "default" ToolTip style has hard-coded colors that will only be different if you are running in high-contrast mode. Otherwise, it will be the light gray gradient you see in the picture above.
The tooltips in the ProPack for VB/C# files use a custom (configurable) style as you noted above.
Please submit feedback that the default tooltip background color should be configurable. The more customer requests are heard for this issue, the higher the likelihood it will be fixed in a future release:
http://connect.microsoft.com/VisualStudio
I'm not sure it is legal or not, we can always disassemble the code and modify (patch) what we want. In this case, find that gray color in assembly and change it. It shouldn't be hard for someone who knows .NET and hexes well.

Standard margins between controls and standard control sizes

For example, Windows Forms Designer offers to place my controls on the form the way there are 12 pixels between form border and control border. It seems too much to me. Is it standard value? Also, as I understand standard button height should be 23 pixels. Am I right? Is there any documents that state all this? And can I setup this default values in Visual Studio (for example what if want default margin between control and form borders, when the snap appears, to be 6 pixels instead of 12)?
You can always refer to the Windows User Experience Guidelines. It comes with a handy table of recommended control sizes. There are drawbacks in using pixel sizes, however.
I don't know of a way to control the snapping behaviour in Visual Studio, though. Apparently it can't be done. You can set a grid size, but it won't affect the dynamic snapping lines.
To change the snapping options, go to Tools > Options > Windows Forms Designer. There is a 'Layout Settings' category that include a setting called 'GridSize'.
As far as standards are concerned, I see them fading away with the arrival of technologies that focus on the user experience (WPF/Silverlight). Look at Expression Blend for instance. Not very standard, right? I think delivering a great user experience in each app is much more important than having a common GUI style across all apps.

Resources