How to set Initial DeskBand Width? - winapi

I have a deskband based on the MS sample. It shows as an item via right click taskbar, toolbars. I find that when initially opened it's using the DBIM_MINSIZE instead of the DBIM_ACTUAL size. Why is that?
What is the appropriate way to set the initial width (bonus, when the deskband is closed (remove checkbox from toolbar) then opened again, how do you have it use the prior width)?
TIA!

Related

"Always show selection" doesn't work on CListCtrl in list mode

I want a user to be able to select item(s) in my CListCtrl and then click on a button to act on those items. But when the focus is lost from the list, the selection is no longer shown, even if I set 'Always show selection' to true:
This happens both in the dialog test facility, and in my compiled application. I use list-mode, and have no icons, only text.
To reproduce:
Create a new dialog in the resource editor
Place a list-view control.
Set View = List in the properties
Set Always Show Selection = True in the properties
Add a button to the dialog
Press Ctrl-T to test the dialog
Select item(s) on the list, then press the button
..and the text is not visibly selected at all. Or is it... I can just
barely sort of see some very very faint selection in my screenshot - I
think. It's so faint I am not 100% certain it's there!
In addition to my comments: well, there you have it - they are selected, and in a different color, but it seems your screen settings are a bit off. Maybe your color settings, a high contrast mode, or the color setting for selected items in Windows.
The gray color in your screenshot is: #f7f3f7 - light gray, so you might have a problem seeing it, depending on the settings.
An interesting and very lightweight tool to check those things (zoom in, see the color values) is ZoomPlus. I use it every day, and there seems to be source code available too.

TeeChart TLegendScrollBar visual issue when clicking on scroll-arrow

IDE: c++ Builder XE5 Update 2
TeeChart: TeeChart Pro 2014.11.140512 VCL/FMX release
I utilized TeeChart's TLegendScrollBar tool for the first time recently(handy tool).
The issue I have come across:
When clicking on one of the scroll-arrows the following happens:
Single Click - The owner chart's TChart.Color property changes(background color). The original color is then restored once another event updates the chart.
Hold Down - The owner chart's TChart.Color property randomly toggles between the original color and unwanted color.
The color changes seems to happen after a TChart.OnAfterDraw call(after the intial OnAfterClick call for the Single Click case).
Example(Before and After):
Easy to replicate:
Create new VCL Forms application and add a TChart component to the form.
Add a TLegendScrollBar tool and number of series to the chart(chart editor).
Set the TChart.Legend.MaxNumRows property to a value smaller than TChart.SeriesCount().
Run.
Questions:
Is there a entry point(s) after TChart.OnAfterDraw wherein I could attempt to rectify the issue? Or a workaround?
(if not 1) Is there a way to completely remove(hide and disable) the scroll arrows?(force the user to use either the mouse-wheel or scroll-thumb to scroll the legend)
I could reproduce the problem so I've added it to the public tracker: B979
You can follow the ticket to get automatic notifications when an update arrives.

VB6 + how to switch between windows/frame in form by buttons

I am very new beginner with VB6 and I hope I explain the things right
I want to create form with 2 buttons (the buttons are located on the top form position )
So each button will switch to other form/window/frame
For example
The first button will show window 1 (there I can set only parameters)
The second button will show window 2 (there I can set only IP address)
Please advice if we can do that by VB6 ?
And if yes how to do that ( step by step )
Remark - Similar example but with multiple windows in the same form is the system properties ( right click on my computer and properties ) , the we can see each button will view different window
Create a form with 2 buttons, Command1 and Command2.
On this form, create 2 frames, Frame1 and Frame2. hide Frame2 and make sure to line up both framesso that they are of the same size and located right on top of each other (Top, Left, Width and Height properties must be the same)
Now put this code in:
Private Sub Command1_Click()
Frame1.Visible = True
Frame2.Visible = False
End Sub
Private Sub Command2_Click()
Frame1.Visible = False
Frame2.Visible = True
End Sub
Now each the first button shows the first frame while hiding the 2nd. The second button hides the first frame and shows the seconds. I think this is the simplest way to implement your task.
PS: don't forget to name your objects properly, it's not a good idea to have default names like Command1 or Frame2 - should be more descriptive than that.
It sounds like you are asking about the tabbed dialog control. To use a tabbed dialog control in VB6:
Click Project -> Components
Scroll down to "Microsoft Tabbed Dialog Control 6.0" and select it.
Click the Apply button.
You should notice a new control in the component tool box. If you do not see the toolbox, click View -> ToolBox. This is the same area of the IDE where you first click to add a button to a form. The tabbed dialog control looks like the top tab of several file folders. When you hover your mouse over the control in the toolbox, you will see a tool tip text of "SSTab". Click this control and then draw a rectangle on your form.
By default, this will add a tabbed dialog control with 3 tabs, but you can change this in the properties window. You can now create any control on top of a tab of the tabbed dialog control and interact with the control exactly the same way you would if the control was placed on the form itself.
What you want is called an MDI Form. It's a form that contains other forms.
You can find a full tutorial on them here, but here's the gist of what you want to do:
Set the "MDIChild" property of all your subforms you want to use to True. Disable their minimize, maximize, and resize functions as well.
Create an MDIForm. Disable its AutoShowChildren property.
Add a toolbar to the MDIForm. Add buttons to the toolbar corresponding to the forms you'll be switching between.
Implement each button's click event, to create child form as expected (or switch to an existing one).

Microsoft Progress Bar Control is missing

I need to create the progress bar on a user form. For inserting progress bar, opened toolbox , right clicked on it and choose “Additional Controls”. (Alternatively, I could go up to the “Tools”/”Additional Controls” menu). But in that list of components, “Microsoft Progress Bar Control 6.0 (SP4)” is missing. I am using Microsoft Office 2010 and Windows 7. Please help me
Two suggestions :)
1) Search your pc for MSCOMCTL.Ocx. If you find it then register it by clicking on Windows Start Button ~~> Run and then typing this text and pressing Enter
regsvr32 C:\Windows\System32\MSCOMCTL.Ocx
I am assuming that the ocx is in C:\Windows\System32
If you don't have that then please download it from here and then repeat the above steps.
Once done, you will now be able to use the control.
2) Please see this link. Sometimes you don't need a progressbar control ;)
Topic: VBA - Working with Scroll Bars - The most simplest way
Link: http://www.vbforums.com/showthread.php?t=511916
HTH
Sid
You can make a makeshift loading bar whit any of the controlls you allready got, by simply useing width.
Example would be useing a label inside a frame, the frame will work as borders for it, so the top and left can be 0, then the total lenght of the frame works as max length for the label.. i think by now you see where im going whit this, basicly now all you gota do is come up whit a counter basicly a loop that counts up to max frame length :)
But, like i said whit creativity, you can use buttons, the form itself, scrollbar basicly contains itself if you dont mind it beeing a unclickable (scroll) button moveing across.

Netbeans - How to do setsize() of a frame?

I have made a GUI in Netbeans. Now I want that the frame size should remain constant, means the user cannot do maximize or restore the frame.
When I go the the frame properties dialog box, I didn't see any property that allow me to set the size of the frame.
I opened the frame properties dialog box by right clicking on the "FrameView" node in the "Inspector" window.
How can I do that?
Uncheck "resizable". That will prevent the user from changing the window size.
Next, set the preferredSize property (if you're using java.awt.Frame instead of JFrame set the minimumSize property instead).

Resources