Custom C# Tools
this document will show you how you can use the controls.
this control allows you to disable each tab seperatey. other than that, it is usable just like the
standard control. this functionality has not been and will apparently not be implemented by MS
(read on the MS site - can not find the link any more though).
create the form with the OsTabControl and set it up as usual. you must also set the DrawMode to
enabling/disabling of the tabs is only possible using code. if your tabControl is called IDT_MAIN and one of the
tabs is called IDT_SUB_TAB_1 then you would write:
IDT_MAIN.DisableTab( IDT_SUB_TAB_1 );
that is all that is to it. once you have disabled the tab
and the user clicks on it, then the tab is not activated. the text
also being grayed.
you could also disable them another way by just setting the
.Enabled flag. the difference is, that the tabs
will not be
grayed until they are repained by the user placing another window on top and removing it again.
IDT_MAIN.EnableTab( IDT_SUB_TAB_1 );
will then enable the tab again ;)
check if en/disabled
there is a function which you can use to check wether the tabPage is en/disabled.
bool bEnabled = IDT_MAIN.IsTabEnabled( IDT_SUB_TAB_1 );
this control allows you to de-select a date by being able to delete the text in the control. the value will always be set to the
last date entered. other than that, it is just like the standard control.
same usage as the normal DateTimePicker. use "if ( 0 == xxx.Text.Length )" to find out if the user does not want a date.
Questions and Answers
Q. do these controls cost anything ?
A. no they do not. you can distribute them with your software as you like. no matter if it is for private or corporate use.
Q. when compiling i get a message saying that it cannot find the OsXxx control
A. when modifying an old project by replacing the eg. TabControl by OsTabControl then you will need to make sure that the
Softwarebrgade.Controls has been added to the dependancies list of the project.
Q. when i have disabled a tab, then it is not being grayed. why ?
A1. have you set the DrawMode of the control to OwnerDrawFixed ?
A2. have you used "IDT_SUB_TAB_1.Enabled = false;" to disable the control ? that way the control is not being redrawn
and the text will stay black until it is being updated by you placing another window on top, so that it will need to redraw
itself. using "IDT_MAIN.DisableTab( IDT_SUB_TAB_1 );" will fix this.
these controls have been created by me to circumvent the problems
i had in
a program that i have written. they are "as is"
with no warrenty what so ever!!
since i am using nant to create the dlls, i can create them
for Framework 1.0, 1,1 and 2.0. i can only test them on 1.1
though, since that is the only version i got.
if you think they will harm your system, then don't use them ;)
do not blame me, if your toaster explodes or your cat suddenly disapears while using these controls.
in case you have a problem, let me know : "Martin AT Softwarebrgade DOT com"