|
News
Bulletin Tech Tips |
|
| |
|
|
July 2010 |
|
|
Tech Tip - Using DragDrop with DBi .NET Controls |
|
| |
|
We’ve
had some questions recently regarding dragdrop in Visual Studio
with our controls, namely why use objects and the data property
on the drgevents as opposed to text. Our answer has always been,
use the data object. Set the data property and in your drop
events for our controls code for the object. Using the getdata
method on the drgevent you can get a reference to any object
that may actually be in there. The follow-up question is
inevitably, “Why do I have to use getdatapresent and getdata?
Where is the strong typing and intellisense?”, and the answer to
that one is, there is none. Because a dragdrop can come from
outside of your application, the drgevent is pretty generic. You
can code to get an Outlook email message, a file, a
dbi-Appointment, or pretty much any object you can think of.
Once you have areference to said object you can write code to
handle various objects coming into your controls. This example
will show how to get a dbiDayView appointment into dbiSchedule…
it will take the appointment, calculate where it was dropped in
the schedule, create a timebar at the new position and set it’s
duration to be that of the appointment item.
Private Sub DataGridView1_CellMouseDown(ByVal sender As Object,
ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs)
Handles DataGridView1.CellMouseDown
Dim dataRow As System.Windows.Forms.DataGridViewRow =
Me.DataGridView1.Rows(e.RowIndex)
DoDragDrop(dataRow, DragDropEffects.Copy)
End Sub
Private Sub DbiDayView1_BeforeAppointmentDrag(ByVal sender As
Object, ByVal e As
Dbi.WinControl.DayView.BeforeAppointmentDragEventArgs) Handles
DbiDayView1.BeforeAppointmentDrag
'Start a dragdrop but use the appointment in the Data object of
'the DoDragDrop
Me.DoDragDrop(e.Appointment, DragDropEffects.Move)
End Sub
Private Sub DbiSchedule1_BeforeTimeBarDrop(ByVal sender As
Object, ByVal e As
Dbi.WinControl.Schedule.BeforeTimeBarDropEventArgs) Handles
DbiSchedule1.BeforeTimeBarDrop
'Check to see if the drag is coming from a DataGridView
'Just a random control to highlight you can handle
'dragdrop from multiple sources.
If
e.drgevent.Data.GetDataPresent(GetType(System.Windows.Forms.DataGridViewRow).ToString)
Then
Dim dataRow As System.Windows.Forms.DataGridViewRow
dataRow =
e.drgevent.Data.GetData(GetType(System.Windows.Forms.DataGridViewRow).ToString)
e.TimeBarItem.Start = dataRow.Cells(3).Value
e.TimeBarItem.End = dataRow.Cells(4).Value
e.TimeBarItem.Text = dataRow.Cells(2).Value
e.AllowDrop = True
End If
'Check to see if the drag is coming from a dbiAppointmentItem
If
e.drgevent.Data.GetDataPresent(GetType(Dbi.PIM.dbiAppointmentItem).ToString)
Then
'Set a reference to the GetData
Dim curAppt As Dbi.PIM.dbiAppointmentItem
curAppt =
e.drgevent.Data.GetData(GetType(Dbi.PIM.dbiAppointmentItem).ToString)
'Change the timebar that was created to reflect the data in the
appointment.
'Since it's a move, use the timebar start and add the timespan
of the appt
e.TimeBarItem.End =
e.TimeBarItem.Start.AddMilliseconds((curAppt.End -
curAppt.Start).TotalMilliseconds)
e.TimeBarItem.Text = curAppt.Text
e.AllowDrop = True
'Because we did a move I want to remove the appointment from
'the dbiDayView
Me.DbiDayView1.Appointments.Remove(curAppt)
End If
End Sub
As always take care and have a great day! |
Keywords Text Mining:
Private Sub | appointment | controls
dragdrop | getdata
Dim dataRow | sender
seo keywords by
www.Extractor.com |
| |
|
|
June 2010 |
|
|
Tech Tip - Using LINQ Aggregate Functions |
|
| |
|
While
working on an upcoming demo, we had a need to get a count of
appointments of a particular type. In fleshing this concept out,
we needed a few for-each-loops to determine what "apptTypes"
were on a given day and then get a count of each. This sounded
like it might be a good challenge for LINQ. Instead of making a
hash table or key-pair dictionary we looked at some of the ways
we could achieve what we were after. A quick test class to mimic
a dbiAppointment with an apptType property and one LINQ
statement to get the counts, then a second to get a total, and
voila, we had all the information we needed in a very tidy code
block.
VB6 Sample Code
Public Class PaulAppt
Public StartDate As Date
Public EndDate As Date
Public ID As Guid
Public ApptType As Long
Public Sub New()
ID = Guid.NewGuid
End Sub
End Class
Public ApptColl As New System.Collections.Generic.List(Of
PaulAppt)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim curLINQ = From Appt In ApptColl _
Group Appt By Appt.ApptType Into Count() _
Select ApptType, TotalAppts = Count
For Each obj In curLINQ
Me.ListBox1.Items.Add(obj.ApptType.ToString + " | " +
obj.TotalAppts.ToString)
Next
Dim sumLineTotal = (From curItem In curLINQ _
Select curItem.TotalAppts).Sum
Me.ListBox1.Items.Add(sumLineTotal.ToString)
End Sub
LINQ rocks.
As always, take care and have a great day! |
Keywords Text Mining:
LINQ | Sub | apptType
curLINQ | Group Appt
Dim curLINQ | Public ApptColl
seo keywords by
www.Extractor.com |
| |
|
|
May 2010 |
|
|
Tech Tip - Exporting the images from COM controls
|
|
| |
|
One
of the biggest drawbacks we've heard for replacing controls in
projects with newer revs is the loss of the internal images.
Older apps that have embedded images often no longer contain the
files for those images once they are imbedded in the controls.
In the past developers have used various methods to extract this
information using screen caps or scrapping the images all
together and rebuilding from the ground up. When asked this, we
often recommend using the ListImage property and the
ImageListCount to extract those files. Well instead of waiting
for people to ask we thought we'd just provide a couple of code
snippets... without further ado... as always take care and have
a great day!
VB6 Sample Code
Private Sub Command1_Click()
Dim imgCount As Long
For imgCount = 1 To Me.ctDayView1.ImageListCount
SavePicture Me.ctDayView1.ListImage(imgCount),
"C:\ImageDump\Img" + CStr(imgCount) + ".bmp"
Next
End Sub
VFP9 Sample Code
PUBLIC imgCount as Long
FOR imgCount = 1 TO thisform.ctDayView1.ImageListCount
SAVEPICTURE(thisform.ctDayView1.ListImage(imgCount),"C:\ImageDump\Img"
+ LTRIM(STR(imgCount)) + ".bmp")
NEXT imgCount |
Keywords Text Mining:
images | imgCount |
controls | Sample Code
Private Sub | extract |
loss
seo keywords by
www.Extractor.com |
| |
|
|
April 2010 |
|
|
Tech Tip - Creating a dbiWSF Project from a Template
|
|
| |
|
In line
with our sneak peek, DBI is on the verge of releasing a new
Framework product called the DBI Warehouse Shipments Scheduling
Framework (dbiWSF for short). This product is a culmination of
our development, production and consulting groups to give
developers in the Warehousing industry a pretty powerful toolset
to craft an application from the ground up. The dbiWSF
encompasses several of our marquee controls, dynamic databinding
(SQL or any ADO.NET OLE DB), and true independent n- tier
development classes (object layer, databinding, UI, business
rules and reporting).
To get developers started with their projects we've included a
project template that can be used to not only connect to a
database, but we've included in the template all the licensing
information needed for the LC.exe for all the customized
dbiComponents (pulled from Solutions::Schedule for .NET
Enterprise and Studio Controls for .NET). This eliminates the
need to have dummy forms or to manually modify the licenses.licx
file.
To begin there will be a new VB.Net project type... in your
Visual Studio, select create new project, VB.Net... click
here for
full image presentation
When you hit ok, you get a module that connects the databinding
and two dialogs that contain two of the key dbiComponents -
dbiWSFDayView (dbiDayView from the Studio Controls for .NET
product) and dbiWSFSchedule (dbiScheduleE from the
Solutions::Schedule for .NET Enterprise product). You also get a
main form that has some information on how to call the dialogs
and apply the WSF Objects to the forms.
click here for
full image presentation
Now because the project template has all the references, not
only is it a great starting place... but without adding anything
else to the project it can just be run to see how the product
functions...
click here for
full image presentation |
Keywords Text mining:
template | dbiWSF |
NET Enterprise |
Studio Controls |
databinding | Framework product |
DBI
seo keywords by
www.Extractor.com |
| |
|
|
March 2010 |
|
|
Tech Tip - I Using ctTips to show a tip in the
ctSchedule List Area |
|
| |
|
With the new hittest methods surfaced in
ctSchedule for COM v10, we can now show tooltips on the
ListItems in the ctSchedule control. We've used our own ctTips
control (available in Studio Controls for COM) for a nicer
presentation and quicker coding.
The code is very straightforward... in the mousemove event we
check to see that we are over the list and not on the same line
item (using a public variable)
<vb6 Code>
Public CurItemOver As Long
Private Sub ctSchedule1_MouseMove(Button As Integer, Shift As
Integer, x As Single, y As Single)
Dim ConvertedX As Integer
Dim ConvertedY As Integer
'Convert the supplied X and Y coordinates to pixels
ConvertedX = x / Screen.TwipsPerPixelX
ConvertedY = y / Screen.TwipsPerPixelY
Dim ScheduleArea As Integer
'Find out what section of the schedule control the mouse is
over.
ScheduleArea = Me.ctSchedule1.ScheduleItemAt(ConvertedX,
ConvertedY)
'Find out which line item is under the mouse
ItemUnderMouse = Me.ctSchedule1.LineAt(ConvertedY)
If ScheduleArea = 2 Then 'If the mouse is over the list, show
the ctTip.
If CurItemOver <> ItemUnderMouse Then
CurItemOver = ItemUnderMouse
Me.ctTips1.ShowText = "This is the Item Over Tip" + vbCrLf +
vbCrLf + "The mouse is over item: " + vbCrLf +
CStr(ctSchedule1.ItemText(ItemUnderMouse))
End If
Else
Me.ctTips1.HideTips
End If
End Sub
The settings for the ctTips are as follows...
Tech Tip March 2010
As always, take care and have a great day! |
Keywords Text Mining:
ConvertedY | control |
ScheduleArea |ctTips |
vbCrLf |
ItemUnderMouse |
seo keywords by
www.Extractor.com |
|
|
| February 2010 |
|
|
Tech Tip I -
Extractor
Keyword
Extraction
Web Service
What is it?
The Extractor Web Service is a web API built in Visual Studio .NET that
wraps the Extractor Engine to allow developers to integrate text
summarization functionality quickly and easily into their applications.
Why would I want to use it?
The ability to read a document and capture its key words and phrases is
a necessity when evaluating, comparing, and cataloging documents.
Typically key word/phrase extraction requires the reading of the
document in order to glean the intent or topics being presented and the
subsequent capture (keying) of the key words and phrases into a data
store. Extractor reads
documents and returns the key words and phrases with a very high
accuracy, removing the need for human involvement.
How do I use it?
1.
Obtain an Application ID from DBI Sales.
2.
Create a new project, in this case we will build a VB.NET Winforms
project.
3.
In the Solution Explorer right click on the References node and select
"Add Service Reference".
4.
In the Address field enter
http://www.picofocus.com/DemoEngine/dbiExtractorDemoWebService.asmx
5.
Click the Go button and the service will be discovered and listed in the
services box on the left of the dialog.
6.
Change the Namespace from the default to dbiExtractorWS
and press the OK button.
Your project will now include a Service References node under which the
dbiExtractorWS is listed.
7.
In your form add 2 text boxes with their Multiline property set to True
and the Scrollbars set to Vertical.
Name the first TextBox Extractee, and the second TextBox
Extraction. Add a Button to
the form and name it ExtractText.
8.
In the ExtactText_Click Event add the following code
Private Sub ExtractText_Click(ByVal
sender As System.Object, ByVal e As System.EventArgs) Handles
ExtractText.Click
Dim xTractee As New Xml.XmlDocument
Dim xTraction As New Xml.XmlDocument
Dim xTractionNode As Xml.XmlNode
Dim resultNodes As Xml.XmlNodeList
Dim xtractorStatus As String
'Set
the properties of the Extraction Request ...
xTractee.LoadXml("<ExtractionRequest " & _
"ActivateHTML=""OFF"" " & _
"ActivateEmail=""OFF"" " & _
"PhrasesRequested=""10"" " & _
"LanguageID=""1"" " & _
"CharCodeID=""1"">" & _
"<EXTRACTEE >" & _
Me.Extractee.Text & _
"</EXTRACTEE>" & _
"</ExtractionRequest>")
'Process the Extraction Request.
'NOTE: Web Services by nature marshal
XML Documents as XML Nodes.
'
Pass in the first (and only) node in the document to the web
service.
'NOTE: Place your unique Application ID in the call below.
xTractionNode = Xtractor.ProcessXtraction("<Application ID From
DBI>", xTractee.FirstChild)
'Place the returned XML Node into the xTraction Document.
xTraction.AppendChild(xTraction.ImportNode(xTractionNode, True))
'Check the status of the Extraction
Request
xtractorStatus = xTractionNode.Attributes("ExtractionStatus").Value
If xtractorStatus = "1" Then
'Extraction
Successful
'Get
all of the Result Nodes.
'NOTE: In the
Extraction Request above we set PhrasesRequested to 10.
resultNodes = xTraction.GetElementsByTagName("Result")
'Iterate
through the Result Nodes and print out the Key Phrases and Highlights.
Dim resultNode As Xml.XmlNode
For Each resultNode In resultNodes
Me.Extraction.Text = Me.Extraction.Text & _
"Key Word/Phrase: " & resultNode.Item("KeyPhrase").InnerText &
vbCrLf & _
"Highlight: " & resultNode.Item("KeyHighlight").InnerText &
vbCrLf & vbCrLf
Next ResultNode
Else
Me.Extraction.Text = "Error Encountered" & vbCrLf & vbCrLf
Me.Extraction.Text = Me.Extraction.Text & vbCrLf & "Extractor
returned a code of " + xtractorStatus
Me.Extraction.Text = Me.Extraction.Text & vbCrLf & vbCrLf &
xTractionNode.InnerText
End If
End Sub
9.
Run the application. Copy
and Paste some text into the Extractee Text Box.
NOTE; The application is
requesting 10 Key Words/Phrases so make sure you have enough text to
reasonable expect 10 themes or topics to be returned.
10.
Press the ExtractText button to request and present the extraction of
the text entered in the Extractee Text Box.
11.
If no errors are encountered the Extraction Text Box will display the
top ten Key Words and Phrases from your text along with a highlight
(sentence) from the original text illustrating
the most prominent use of the key word or phrase within the
document.
Summary
The application described above is a simple implementation of the
Extractor Content Summarization Web Service which only touches the
surface of the power of the Extractor
component software. For
more information on Extractor, the Extractor Web Service, and the
potential of Extractor for your specific development needs please visit
www.Extractor.com or contact dbi
Sales via email through
sales@dbi-tech.com.
|
Keywords
Text Mining:
Dim ConvertedX | Extractor |web service
xtractorStatus |key words | Dim | phrases
seo keywords by
www.Extractor.com |
| |
|
Tech Tip II - Solutions Schedule
for .NET DrawToBitmap
There is a method on the dbiSchedule control that allows users to create
a bitmap image of the Schedule in memory (as opposed to the CreateImage
method which creates a file). The reason for bringing this up is
twofold as more of our user-base invest in the development of
their products, the need for reporting with the schedule has
increased. Windows Vista and Win7 have tightened file access
even more, so dumping the schedule image to a file for reporting
has gotten a bit cumbersome. This feature can also be used to
create an IO Stream of the image to be transported across
network protocols and can add a level of integration to
Share-point or Office documents. The usage is pretty straight
forward
I just throw the .bmp into an ImageBox for display purposes.
Dim
newBMP As Bitmap
newBMP =
New Bitmap(Me.DbiSchedule1.Width,
Me.DbiSchedule1.Height)
Me.DbiSchedule1.DrawToBitmap(newBMP,
Rectangle.Round(newBMP.GetBounds
(System.Drawing.GraphicsUnit.Pixel)))
Me.PictureBox1.Image = newBMP
As always, take care and have a great day! |
Keywords
Text Mining:
schedule | newBMP |
bitmap image | reporting |
dbiSchedule control |
NET DrawToBitmap |
Solutions Schedule
seo keywords by
www.Extractor.com |
| |
|
|
January 2010 |
|
| |
|
LINQ to Objects and LINQ to SQL
While working with the latest cuts of the LINQ
objects in the .NET framework 4.0 for one of our up coming products, we
jumped straight into LINQ to Objects at the programming tier
instead of LINQ to SQL at the data layer. Turns out this was not a bad decision,
as it appears Microsoft is also focusing more on the LINQ to Entity Framework
instead of the LINQ to SQL model
(see
http://blogs.msdn.com/adonet/archive/2008/10/29/update-on-linq-to-sql-and-linq-to-entities-roadmap.aspx
).
And for us this is actually more in line with our own coding practices. As our
.NET controls are designed to be used with objects, we've tried to leave the
database work to the individual developer.
As enterprise customers invest in Database Administrators and begin the migration to scalable data sources the act of getting
at the data in a true n-tier approach lends itself well to the data layer
interacting with objects, which in turn interacts with the interface layer. For
example a Customer will typically have a name, address, phone number (ok at this
stage a collection of contact numbers) and other generally static information.
As a developer I am more concerned with the object representation Customer.Name,
than whether that info is stored in a SQL field called cust_Rec_Static.Last_Name
or in an XML document under the tag <Customer> <Name>.
I've always looked at
n-tier programming with a sidelong glance, in my consulting career I was the
architect from the data access layer right on down to the security model. But while
working with some of our current development projects (and yes, the product
manager was in that mix) I've come around to the object model way of thinking. I
really enjoy the extensibility of objects. It always drove me to drink when
looking at someone else's customer model. Why did they store the phone numbers
as strings... wouldn't a phone number be so much better as an object... areacode,
exchange, number, longdistance prefix, extension... now I can take and manage
each one of those independently and all of a sudden using ITapi just became sooo
much simpler.
And now back from my rambling... imagine if you needed to create
an application that called numbers from a list. Now, using LINQ you can assign
call blocks to your operators by areacode and exchange. You can easily apply
business rules in a tertiary tier using the same objects. And don't even get me
started on webservices. They are just plain cool.
Forgive my rambling tip today, as we get further
into the new year, some of the work we have been doing on projects
related to the controls will make these musings much more relevant. |
LINQ | SQL
|customer
data layer |developer
NET framework | rambling
seo keywords by
www.Extractor.com |
| |
|
|
December 2009 |
|
| |
Keywords: |
|
A generic resize function for ctPanel
Good day! Todays tech tip is from one of our demo's (why you ask would one
surface code already distributed with a demo must be the eggnog ok its
just cause it can save some time and we like saving time for our devs)
from the newest release of SCCOM 1.1 ctPanel. I won't go into the
sales speak here, suffice to say, ctPanel is a nifty little size control
that lets you synch up multiple controls with horizontal and/or vertical
splitters. As this isn't a true host container it made sense to have a
single function to resize controls. As we are currently supporting both
VB6 and VFP9 on the COM side of things, we thought we'd provide both
functions basically in the resize events for each panel, you can call
this function with the control associated with that panel
as always, our sample code is conceptual, your needs may require tweaking...
Visual Basic 6
Private Sub ResizeControl(ByVal curCtrl As Control, newTop As Long, newLeft As
Long, newRight As Long, newBottom As Long, Padding As Long)
'This custom method will resize a supplied control to fill
an entire panel of the control.
If curCtrl.Visible Then
curCtrl.Top = Me.ctPanel1.Top + newTop + Padding
curCtrl.Left = Me.ctPanel1.Left + newLeft + Padding
curCtrl.Width = newRight - newLeft - (Padding * 2) 'Padding
times 2 because it has to come off both sides
curCtrl.Height = newBottom - newTop - (Padding * 2)
'Padding times 2 because it has to come off both top/bottom
End If
End Sub
Visual Fox Pro 9
LPARAMETERS curCtrl As Control, newTop As Long, newLeft As
Long, newRight As Long, newBottom As Long, Padding As Long
&& This custom method will resize a supplied control to fill an entire panel of
the control.
IF curCtrl.Visible
curCtrl.Top = Thisform.ctPanel1.Top + newTop + Padding
curCtrl.Left = Thisform.ctPanel1.Left + newLeft + Padding
curCtrl.Width = newRight - newLeft - (Padding * 2) && Padding times 2 because it
has to come off both sides
curCtrl.Height = newBottom - newTop - (Padding * 2) && Padding times 2 because
it has to come off both top/bottom
ENDIF
Then to call these functions from the panel resize events...
Visual Basic 6
'The p1Resized event fires everytime the first panel
in the ctPanel control is resized,
'Or that the control redraws itself. This event will receive the new
Top,Left,Right, and
'Bottom values of the panel. These values can then be used to adjust, move and
size any
'controls being displayed inside the panel.
If bVisible And (nRight - nLeft > 5) Then
Me.ctText16.Visible = True
ResizeControl Me.ctText16, nTop, nLeft, nRight, nBottom, 2
Else
Me.ctText16.Visible = False
End If
Me.Panel1Width.Value = Me.ctPanel1.p1Width
End Sub
Visual Fox Pro 9
*** ActiveX Control Event ***
LPARAMETERS bdisplay, ntop, nleft, nbottom, nright, bvisible
&& The p1Resized event fires everytime the first
panel in the ctPanel control is resized,
&& Or that the control redraws itself. This event will receive the new
Top,Left,Right, and
&& Bottom values of the panel. These values can then be used to adjust, move and
size any
&& Controls being displayed inside the panel borders.
If bVisible And (nRight - nLeft > 5)
Thisform.Panel1Frame.Visible = .T.
Thisform.resizecontrol(Thisform.Panel1Frame, nTop, nLeft, nRight, nBottom, 2)
Else
Thisform.Panel1Frame.Visible = .F.
EndIf
Thisform.Panel1Width.Object.Value = Thisform.ctPanel1.p1Widt
|
control
|panel | nright | nleft | nbottom | ntop | ctPanel
seo keywords by
www.Extractor.com |
| |
|
|
November 2009 - Vol. 1 |
|
| |
Keywords: |
Tech Tip - Installing on Windows 7
I hope everyone had a fun Halloween. Normally in the TechTip corner of
the universe we try to come up with some code or a different perspective
on using our controls, however the release of Windows 7 has been on our
support-type minds a fair bit recently. I just thought I d take a moment
to discuss our product lines and how they play with Windows 7. We ll
start with the beginning we put a bit of time and effort into the new
Product Manager technology for both Vista and Windows 7. The primary
push came from dealing with the UAC issues. We manifested the installs
to require administrator privileges as there are a fair number of
registry settings associated with the controls (both COM and .NET).
There is just no getting around that. So if you are seeing C0000005
errors, chances are you need to right click the shortcuts and run as
administrator or ensure you have full local administrator rights.
We do have several UAC enabled test beds and have tested the
various cuts of the latest controls against the different
scenarios. One scenario that still haunts some users is the
UAC with non-manifested IDE environments. If you licensed
your controls but still see C0000005 errors in your apps,
ensure that you are running your Development Environment as
an administrator. For the Visual Studio .NET crowd ensure
you have the latest service packs installed for your
VS2005/VS2008 as these ship with manifested executables.
Also if you are manually registering your .OCX controls on
Vista/Win7 machines, be sure to check out our FAQ on
regsvr32 issues here
http://www.dbi-tech.com/Support/FAQ/default.aspx?66 If
you are still having any issues with the latest versions of
the controls (for more information on the current product
line supported on Windows 7, please see
http://www.dbi-tech.com/ProductLifeSupport.aspx ) contact us via the
Support Tab in the product manager.
Also, don t forget to check your product managers for updated controls,
help files and samples. |
controls | product manager | administrator | Windows | UAC |
support-type | non-manifested IDE environments
seo keywords by
www.Extractor.com
|
| |
|
|
October 2009 |
|
| |
Keywords: |
|
Tech Tip Oct 2009
- Custom images in the new dbiTips control
One of the more
powerful features of the dbiTip control is the ability to create and
display a dbiTipsObject. This object encapsulates the several areas of a
dbiTip including the header, footer and body areas including images
'We are making a tip for a timebar, so I have a function that returns a
dbiTipsObject
Me.dbiTipsMain.ImageOnly
=
False
Dim curTip As
Dbi.WinControl.Tips.dbiTipsObject = MakeTipForTimeBar(e.TimeBarItem)
Me.dbiTipsMain.Show(curTip)
And the function to make a dynamic tip
read more
|
dbiTipsObject | vbCrLf | bodyString | breakout docks | footer
| Dim | cargo types
seo keywords by
www.Extractor.com
|
| |
|
|
September 2009 |
|
| |
Keywords: |
Tech Tip
-
Alpha-channel timebars to give
transparency in Solutions
Schedule
for .NET
Ok, if certain retail outlets are going to start inundating
us with Halloween stuff already, we are going to roll out
timebar ghosts.. aka Spoooky timebars.
In working with our own internal development one of my
support staff came up with a really awesome and simple way
to make the timebars semi-transparent using the alpha
channel. This allows the background image of the schedule to
show through which will allow you to better see customareas
and other timebars underneath the selected timebars.
We simply change the background color of the selected
timebars using the alphachannel overload of the color
library.
Me.DbiSchedule1.BarSelectBackColor
= Color.FromArgb(80, Me.DbiSchedule1.TimeBarBackColor)
Me.DbiSchedule1.BarSelectBackColorTo
= Color.FromArgb(80, Me.DbiSchedule1.TimeBarBackColorTo)
Me.DbiSchedule1.BarSelectForeColor
= Color.White
-Before: Can t really see where the shipment behind ends and
the outline is the only way to indicate you are in a custom
area

-After: You can clearly see where the underlying shipment
ends and the custom area is readily apparent

|
timebars | Solutions Schedule |background color | selected
timebars | custom area | background image | inundating
keywords provided by
www.Extractor.com |
| |
|
|
Back To The
Top |
|
|
|
|
August 2009 |
|
| |
Keywords: |
Tech Tip - Using DragDrop with
DBI .NET Components
We ve
had some questions recently regarding dragdrop in Visual
Studio with our controls, namely why use objects and the
data property on the drgevents as opposed to text. Our
answer has always been, use the data object. Set the data
property and in your drop events for our controls code for
the object. Using the getdata method on the drgevent you can
get a reference to any object that may actually be in there.
The follow-up question is inevitably, Why do I have to use
getdatapresent and getdata? Where is the strong typing and
intellisense? , and the answer to that one is, there is
none. Because a dragdrop can come from outside of your
application, the drgevent is pretty generic. You can code to
get an Outlook email message, a file, a dbiAppointment, or
pretty much any object you can think of. Once you have a
reference to said object you can write code to handle
various objects coming into your controls. This example will
show how to get a dbiDayView appointment into dbiSchedule
it will take the appointment, calculate where it was dropped
in the schedule, create a timebar at the new position and
set it s duration to be that of the appointment item.
Private
Sub
DataGridView1_CellMouseDown(ByVal
sender As
Object,
ByVal e
As
System.Windows.Forms.DataGridViewCellMouseEventArgs)
Handles
DataGridView1.CellMouseDown
Dim dataRow
As
System.Windows.Forms.DataGridViewRow =
Me.DataGridView1.Rows(e.RowIndex)
DoDragDrop(dataRow, DragDropEffects.Copy)
End
Sub
Private
Sub
DbiDayView1_BeforeAppointmentDrag(ByVal
sender As
Object,
ByVal e
As
Dbi.WinControl.DayView.BeforeAppointmentDragEventArgs)
Handles
DbiDayView1.BeforeAppointmentDrag
'Start a dragdrop but use the
appointment in the Data object of
'the DoDragDrop
Me.DoDragDrop(e.Appointment,
DragDropEffects.Move)
End
Sub
Private
Sub
DbiSchedule1_BeforeTimeBarDrop(ByVal
sender As
Object,
ByVal e
As
Dbi.WinControl.Schedule.BeforeTimeBarDropEventArgs)
Handles
DbiSchedule1.BeforeTimeBarDrop
'Check to see if the drag is
coming from a DataGridView
'Just a random control to
highlight you can handle
'dragdrop from multiple sources.
If
e.drgevent.Data.GetDataPresent(GetType(System.Windows.Forms.DataGridViewRow).ToString)
Then
Dim dataRow
As
System.Windows.Forms.DataGridViewRow
dataRow = e.drgevent.Data.GetData(GetType(System.Windows.Forms.DataGridViewRow).ToString)
e.TimeBarItem.Start = dataRow.Cells(3).Value
e.TimeBarItem.End = dataRow.Cells(4).Value
e.TimeBarItem.Text = dataRow.Cells(2).Value
e.AllowDrop = True
End
If
'Check to see if the drag is
coming from a dbiAppointmentItem
If
e.drgevent.Data.GetDataPresent(GetType(Dbi.PIM.dbiAppointmentItem).ToString)
Then
'Set a reference to the GetData
Dim curAppt
As
Dbi.PIM.dbiAppointmentItem
curAppt = e.drgevent.Data.GetData(GetType(Dbi.PIM.dbiAppointmentItem).ToString)
'Change the timebar that was
created to reflect the data in the appointment.
'Since it's a move, use the
timebar start and add the timespan of the appt
e.TimeBarItem.End = e.TimeBarItem.Start.AddMilliseconds((curAppt.End
- curAppt.Start).TotalMilliseconds)
e.TimeBarItem.Text = curAppt.Text
e.AllowDrop = True
'Because we did a move I want to
remove the appointment from
'the dbiDayView
Me.DbiDayView1.Appointments.Remove(curAppt)
End
If
End
Sub

|
drgevent | data property | controls | appointment
|getdata | dragdrop |reference
Dim dataRow | sender | Private Sub | appointment | Sub |
timebar | Dim curAppt
keywords provided by
www.Extractor.com
|
| |
|
|
Back To The
Top |
|
|
|
|
July 2009 |
|
| |
|
| Tech Tip -
Using the Vista Style of ctTips with Solutions Schedule 9 |
|
|
Today s tip is a bit of a product
crossover, using the ctTips from SCCOM with the latest version
of SolSched9 to make things very pretty indeed.
We ll start with a picture as they are
worth the proverbial thousands of words

|
Keywords:
Solutions Schedule|
Studio Controls|
ctTips|
Developer|
License |
keywords provided by
www.Extractor.com
|
|
As you can see we have a pretty nifty
looking tooltip populated with information from the timebar. It
doesn t take a lot of code to setup, simply add a ctTips control
to your form and using the following code we can set it up with
a few lines of code
To start things off we ll throw some code
out I ve put the pertinent details in the code comments
Dim TipsText As String Global for synching
the Events
Dim FooterText As String Global for
synching the Events
Private Sub Command1_Click()
'Load some sched items and bars
LoadSched
'Ensure that we disable the internal ctSchedule tips
Me.ctSchedule1.TipsType = TipsNone
'Setup the ctTips for Vista Styles
ctTips1.ControlStyle = StyleVista
ctTips1.TextAlign = TextLeft
ctTips1.FillType = FillVertical
ctTips1.TipsTextXOffset = 0
ctTips1.TipsTextYOffset = 0
ctTips1.ForeColor = &H80000017
ctTips1.BackColor = &HFFFFFF
ctTips1.BackColorTo = &HE7E7DA
ctTips1.TitleVisible = True
ctTips1.FooterVisible = True
ctTips1.TitleFont = Me.ctTips1.Font.Bold
ctTips1.FooterFont = Me.ctTips1.Font.Bold
'Add the ctSchedule control to the ctTips
'We use the AddEnhancedTips method so we get the nice
'headers and footers. Note the image is stored in the
'internal image list for ctTips (see image below)
ctTips1.AddEnhancedTips ctSchedule1.hWnd, "", "Time Bar Over",
1, 0
End Sub
Private Sub ctSchedule1_ScheduleOver(ByVal
nIndex As Integer, ByVal nBar As Integer)
If nBar = 0 Then
'Hides and clears the
tips text, setting the tipstext = ""
'will
ensure it doesn't pop up when not over a timebar
ctTips1.HideTips
TipsText = ""
FooterText = ""
Else
'Set
the tipsText global variable, we'll use this in the
'BeforeTipDisplay
as we need the nIndex to associate
'the
proper text with the tip.
TipsText = Me.ctSchedule1.BarText(nIndex, nBar) + Chr(10) + _
"StartTime:
" + TimeFromMinutes(Me.ctSchedule1.BarTimeStart(nIndex, nBar)) +
Chr(10) + _
"End
Time: " + TimeFromMinutes(Me.ctSchedule1.BarTimeEnd(nIndex, nBar))
+ Chr(10) + _
Chr(10)
+ _
"We
use a title, footer, and" + Chr(10) + _
"body
to create the tip. Each" + Chr(10) + _
"section can contain its own" + Chr(10) + _
"text
and/or image."
'Set
the footer text so the tip is easily identifiable
FooterText = "Timebar Text - " + Me.ctSchedule1.BarText(nIndex,
nBar)
End If
End Sub
Private Sub ctTips1_BeforeTipDisplay(ByVal
nHwnd As Long, ByVal nIndex As Integer)
'Before the tip is displayed set the properties to show our
'customized tip. This is set above in the schedule over event.
Me.ctTips1.CtrlTipsText(nIndex) = TipsText
Me.ctTips1.FooterText = FooterText
End Sub
Private Function TimeFromMinutes(ByVal
lngTime As Long) As String
'This is just a quick function to format
the time,
'and yes, I know it doesn't do
Noon/Midnight, this is a
'techy
tippy cut us some slack!
Dim curHour As Long
Dim curMin As Long
Dim AmPM As String
Dim strTime As String
curHour = Int(lngTime / 60)
curMin = lngTime - (curHour * 60)
If curHour > 12 Then
curHour = curHour - 12
AmPM = "PM"
Else
AmPM = "AM"
End If
strTime = CStr(curHour) + ":" + Format(CStr(curMin),
"00") + " " + AmPM
TimeFromMinutes = strTime
End Function
But a quick overview for those who don t
want to become Analysts for my code. We have two global
variables, one for the body text and one for the footer text as
I customize the tips for each timebar. In the SchedOver event we
check to see if we are over a timebar, if we are set the global
vars, then the ctTips handles the rest.
Back To The
Top
|
|
| |
|
|
June 2009 |
|
| |
|
Tech Tip June
2009 Guidelines in
Solutions Schedule for COM |
|
|
One of
the great new features in Solutions::Schedule for COM (Ver 9) is
the GuideLine. For those that are familiar with the .NET version
of Solutions::Schedule you ll be familiar with the concept. I
was going to work up some sample code, but realized the help
file working with guidelines had all the info I needed so I did
a bit of plagiarism on ourselves. Also, a quick thank you at the
end of today s tip.
Working with Guide Lines
Guide Lines are vertical lines used to represent
specific times in a schedule. Guide lines provide the user with
discrete snap-to functionality making it easier to position
time bars.
Guide lines enhance the process of creating and maintaining a
schedule. Guide lines are not intended to be included in the
static display functionality of the schedule and accordingly
they have certain limitations. Guide lines are not rendered in a
print or print preview report, and are not part of the Undo/Redo
functionality.

Adding Guide Lines to the
Schedules
Guide lines are assigned to a specific schedule
object. Therefore, if the user wants to display a guide line in
multiple schedules for a specific time the guide line must be
created for each schedule object in which it is to appear. There
are two ways to add a guide line to a schedule
1.)
User Interaction: Set the
EditMode property
of the control to GuideLine. Click a point on the schedule. On
the OnMouseUp event, the new guide line will be created.
2.)
Programmatically: Create a GuideLine through code. For example
Dim
curGuideLine as integer
curGuideLine = ctSchedule1.AddGuideLine(540,
me.ctSchedule1.DateStart)
When a
guide line is added with the mouse a
GuideLineAdd
event will be fired by the ctSchedule control. This event can be
used to validate the action and optionally delete the guide line
from the control, or set the appearance of the guide line.
Changing the Position of
a Guide Line
The position of a guide line in a schedule is based on the
GuideDate and GuideTime values. Changing the position of a guide
line can be achieved in one of three ways ...
1.)
User Interaction with the guideline in the schedule: Set the
EditMode
property of the control to GuideLine, Click and drag an existing
guide line horizontally in the schedule. On the mouseup, the
guide line will be set at its new position and time. NOTE: To
move the guideline inside the schedule area the
EditMode
must be set to GuideLine.
2.)
User Interaction with the guideline in the ruler: If an image
has been assigned to a guide line the image appears in the ruler
area. Click and drag the image horizontally in the ruler to
change its time. NOTE: The
EditMode of the
control DOES NOT have to be set to GuideLine.
3.)
Programmatically: Change the value of the
GuideTime
and
GuideDate properties of the
ctSchedule through code. For example
me.ctSchedule1.GuideTime(curGuideLine) = 240
me.ctSchedule1.GuideDate(curGuideLine) = clng(Now)
When a
guide line is moved with the mouse a
GuideLineMoved
event will be fired. NOTE: As a guide line is being moved with
the mouse, the
GuideLineMove
event will be firing.
Removing Guide Lines from
the Schedules
Guide lines can be removed from the ctSchedule in one of three
ways
1.)
User Interaction with the guideline in the schedule: Set the
EditMode
property of the control to GuideLine, Click and drag an existing
guide line horizontally off of the schedule. On the mouseup, the
guide line will be removed.
2.)
User Interaction with the guideline in the ruler: If an image
has been assigned to a guide line, click and drag the image
horizontally off of the schedule. NOTE: The
EditMode
of the control DOES NOT have to be set to GuideLine
3.)
Programmatically: Remove the guide line through code. For
example ...
me.ctSchedule1.DeleteGuideLine curGuideLine
When a
guide line is being removed with the mouse a
GuideLineRemove event will be fired.
Adding Images to a Guide
Line
Each guide line can be assigned an image that is rendered in the
ruler section of the control. By default the image will be
vertically aligned to the bottom of the ruler and horizontally
aligned so that the middle of the image is on top of the guide
line. The position can be changed though the
GuideImageXOffset and
GuideImageYOffset . NOTE: It is possible to
display an image for a guide line inside the actual schedule
instead of the ruler area however this is NOT a recommended
practice as the logic for the guide line images assumes they are
within the ruler area of the schedule. Unpredictable results may
occur by placing them elsewhere. To add an image to a guide line
perform the following
1.)
Assign the Guide Line images to the image list of the ctSchedule.
2.)
To set the default image for all Guide Lines in the ctSchedule
control, assign the index value of an image in the image list to
the
GuideImageIndex property of the ctSchedule
control. After that, all guide lines will use that image unless
the
GuideImage property for a GuideLine index is
set discretely to the index value of a different image in the
ctSchedule image list. Setting the
GuideImage
property of a Guide Line overrides any default image assigned to
the guide lines.
Snapping a Time Bar to a
Guide Line
To cause time bars to be snapped to a guide line, the
SnapToGuideLines property of the ctSchedule
control must be set to True. As one end of a time bar approaches
a guide line the edge of the time bar will become aligned with
the guide line. The distance at which the time bar is snapped
to the guide line is determined in pixels and is defined in the
GuideLineDistance property of the ctSchedule
control.
When a time bar is snapped to a guide line, it is assigned
the actual time of that guide line. For example, if a guide line
is set to 1:13:15 (1 hour, 13 minutes, 15 seconds), when a time
bar is snapped to the guide line, its beginning (or end
depending on the proximity of the guide line) will be set to the
1:13:15 setting.
NOTE : Because the Snap to Guide Lines feature is based on
pixels, a time bar will only snap to a guide line that is
visible within the schedule object. If a guide line is not
visible in the schedule object the time bar will not snap to its
value.
NOTE :
Working with GuideLines and SnapToGrid... please be aware that
if you have snap-to-grid enabled with snap-to-guidelines, be
sure to synchronize the guidelines to the
gridfrequency.
If the guidelines fall too close to the
gridfrequency
but not exactly then there may be issues related to the drawing
of the timebars as they attempt to position themselves to
accommodate both values.
Tech Tip June
2009 Side Note: CodeProject Awards
As I m sure the marketing group has
made mention elsewhere (if they haven t, we need to restrict the
martini lunches), we won a CodeProject award for our SolSched
.NET product (under General Development Tools)
http://www.codeproject.com/PressReleases/809/The-Code-Project-Announces-First-Annual-Members-Choice-Awards.aspx
Since the support department doesn t get much of a chance to
talk directly to our clients outside of questions and issues, I
wanted to take a quick moment to say thanks a ton for the votes
and as always take care and have a great day!
Back To The Top
|
GuideLines|
Solutions Schedule for COM|
EditMode|
TimeBar| |
keywords provided by
www.Extractor.com
|
| |
|
|
May 2009 |
|
| |
|
| Tech Tip May
2009 Using a default timebar style to quickly apply a Vista
Arrow-Glass (Vertical Edge) fill effect to timebars. |
|
|
Welcome and hopefully your spring weather
is much better than up here in Winnipeg. Brrr.
Today s tip is regarding the new Solutions
Schedule for COM (v9.0) and using the default bar properties to
make your timebars look very pretty.

It s fairly straightforward, we ve extended
upon out default bar styles to add fill types and a backcolorto
property
Me.ctSchedule1.BarDefBackColor = vbWhite
Me.ctSchedule1.BarDefBackColorTo = vbBlue
Me.ctSchedule1.BarDefFillType =
FillVertEdge
'or for wider timebars...
Me.ctSchedule1.BarDefFillType =
FillVertEdge2
And for those that would like to see their
changes dynamically we ve added a new property browser method to
enable you to change the colors dynamically. To do this, add a
button to your form and in the click event call the
me.ctSchedule.PropertyPages method like so
Me.ctSchedule1.PropertyPages = Display
Then navigate to the color tab and change
the BarDefBackColor and BarDefBackColorTo properties as desired
(beware you can make some pretty good Circus-Pie color schemes).
If you wish to play with the default fill type you can do this
through the Appearance Tab

Now these are just the defaults, you can
apply individual timebar fills to make unique color combinations
using the standard ctSchedule timebar calls (nindex = item, nbar
= timebar) like so, I ll create two timebars and make one green
and one red

Dim grnBar As Integer
Dim redBar As Integer
grnBar = Me.ctSchedule1.AddKeyTimeBar(1,
180, 240, Me.ctSchedule1.DateStart, Me.ctSchedule1.DateStart,
"Key1")
Me.ctSchedule1.BarBackColor(1, grnBar) =
vbWhite
Me.ctSchedule1.BarBackColorTo(1, grnBar) =
RGB(0, 100, 0)
Me.ctSchedule1.BarFillType(1, grnBar) =
FillVertEdge2
redBar = Me.ctSchedule1.AddKeyTimeBar(2,
180, 240, Me.ctSchedule1.DateStart, Me.ctSchedule1.DateStart,
"Key2")
Me.ctSchedule1.BarBackColor(2, redBar) =
vbWhite
Me.ctSchedule1.BarBackColorTo(2, redBar) =
RGB(100, 0, 0)
Me.ctSchedule1.BarFillType(2, redBar) =
FillVertEdge2
For more information on the new fill styles
or the new guideline functionality (way cool) please check out
the new help file anywhere you see a red star is new
information

Take care and as always have a great day!
Back To The Top
|
Vista|
Fill Edge|
Timebar|
ctSchedule|
Guidelines|
HelpFile| |
keywords provided by
www.Extractor.com
|
| |
|
|
April 2009 |
|
| |
|
|
Tech Tip Using LINQ with dbiSchedule Part 2 Using the TAG
property on a timebar |
|
|
Last month we looked at using LINQ for
filtering a dbiSchedule List. This month we are going to look at
using LINQ on the dbiTimebar.Tag.
To
begin we are going to create an object that holds information
for each timebar. In this case the object will have a collection
on it as well, meaning that in our example we may have a truck
with multiple cargoes on it. We will want to be able to
determine which timebars have cargo manifests containing Freezer manifests. Normally that s a lot of for each looping
and custom collection building, but in this case we will use
LINQ to cut through some of that so without further ado,
here is some code
Partial
Public
Class ItemCargo
'An object that can be used to house
cargo items
Dim l_Capacity
As
Integer
Dim l_CargoCollection
As
New System.Collections.Generic.List(Of
String)
Public
Property CargoCollection()
As
System.Collections.Generic.List(Of
String)
Get
Return l_CargoCollection
End
Get
Set(ByVal
value As
System.Collections.Generic.List(Of
String))
l_CargoCollection = value
End
Set
End
Property
Public
Property Capacity()
As
Integer
Get
Return l_Capacity
End
Get
Set(ByVal
value As
Integer)
l_Capacity = value
End
Set
End
Property
End Class
Private
Sub AddItems()
'Add some items to the Schedule, then
some timebars. Call this from your firstdraw
Dim
newItem1 As
New
Dbi.WinControl.Schedule.dbiScheduleItem
newItem1.Text = "Dock 1"
Dim newTimebar1
As
New Dbi.WinControl.Schedule.dbiTimeBarItem()
newTimebar1.Start = #1/1/2009 3:00:00 AM#
newTimebar1.End = #1/1/2009 5:00:00 AM#
newTimebar1.Text = "Truck #A23993"
Dim newCargoManifest1
As
New ItemCargo
newCargoManifest1.Capacity = 50
newCargoManifest1.CargoCollection.Add("Freezer")
newTimebar1.Tag = newCargoManifest1
newItem1.TimeBars.Add(newTimebar1)
Me.DbiSchedule1.Items.Add(newItem1)
Dim newItem2
As
New Dbi.WinControl.Schedule.dbiScheduleItem
newItem2.Text = "Dock 2"
Dim newTimebar2
As
New Dbi.WinControl.Schedule.dbiTimeBarItem()
newTimebar2.Start = #1/1/2009 2:00:00 AM#
newTimebar2.End = #1/1/2009 4:00:00 AM#
newTimebar2.Text = "Truck #B33993"
Dim newCargoManifest2
As
New ItemCargo
newCargoManifest2.Capacity = 50
newCargoManifest2.CargoCollection.Add("Freezer")
newCargoManifest2.CargoCollection.Add("Cooler")
newTimebar2.Tag = newCargoManifest2
newItem2.TimeBars.Add(newTimebar2)
Me.DbiSchedule1.Items.Add(newItem2)
Dim newItem3
As
New Dbi.WinControl.Schedule.dbiScheduleItem
newItem3.Text = "Dock 2"
Dim newTimebar3
As
New Dbi.WinControl.Schedule.dbiTimeBarItem()
newTimebar3.Start = #1/1/2009 1:00:00 AM#
newTimebar3.End = #1/1/2009 3:00:00 AM#
newTimebar3.Text = "Truck #C223AS"
Dim newCargoManifest3
As
New ItemCargo
newCargoManifest3.Capacity = 50
newCargoManifest3.CargoCollection.Add("Cooler")
newTimebar3.Tag = newCargoManifest3
newItem3.TimeBars.Add(newTimebar3)
Me.DbiSchedule1.Items.Add(newItem3)
End
Sub
Finally
the LINQ to return all the items that have a freezer manifest
Private
Sub Button2_Click(ByVal
sender As System.Object,
ByVal e
As System.EventArgs)
Handles Button2.Click
Dim FreezerQuery =
From dbiItem
As
Dbi.WinControl.Schedule.dbiScheduleItem
In myCollection _
From dbiTimeBar
As
Dbi.WinControl.Schedule.dbiTimeBarItem
In dbiItem.TimeBars _
Where
dbiTimeBar.Tag.CargoCollection.Contains("Freezer")
_
Select dbiTimeBar
For
Each TimeBar As
Dbi.WinControl.Schedule.dbiTimeBarItem
In FreezerQuery
Me.ListBox1.Items.Add(TimeBar.Text)
TimeBar.BackColor = Color.Red
Next
End Sub
Back To The Top
|
LINQ|
dbiTimebar.Tag
Manifests|
Firstdraw Event |
keywords provided by
www.Extractor.com
|
| |
|
|
March 2009 |
|
| |
|
| Tech Tip
- Using LINQ to filter items in Solutions Schedule for
.NET |
|
We have been wondering
what a good application of LINQ would be with some of our
controls so we went on a bit of an excursion this week. This
very small snippet of code will enable you to filter a Schedule
using the dbiScheduleItem text. This example makes the following
assumptions, you need .NET Framework 3.5 as well as a flat list
structure (no child nodes, that would take some more thinking,
but could be easily modded for groups or departments as the
child nodes will move with the parent nodes). Basically we have
a global variable that will house our current schedule items.
During the firstdraw we take a copy of our current list items
and put them into our custom collection using the LINQ.ToList
method. Once we have that copy, we can then apply a LINQ query
to the collection in a button click. I ve used a text box to get
my filter criteria.
And here is the
source code
'Global variable for holding the master
copy of our data
Dim myCollection
As
New Collections.Generic.List(Of
Dbi.WinControl.Schedule.dbiScheduleItem)
Private
Sub DbiSchedule1_FirstDraw(ByVal
sender As
Object,
ByVal e
As
Dbi.WinControl.Schedule.FirstDrawEventArgs)
Handles DbiSchedule1.FirstDraw
'Load your data, I am using a read
XML
Windows.Forms.Cursor.Current = Cursors.WaitCursor
Me.DbiSchedule1.ReadXMLFile("LargeData.xml")
Windows.Forms.Cursor.Current = Cursors.Default
'Create the LINQ query to create the
copy of all our items.
Dim mySchedItems =
From schedItems
As
Dbi.WinControl.Schedule.dbiScheduleItem
In Me.DbiSchedule1.Items
_
Select schedItems
'Use the .ToList method on the LINQ
query to set our Global
myCollection = mySchedItems.ToList
End
Sub
Private
Sub Button1_Click(ByVal
sender As System.Object,
ByVal e
As System.EventArgs)
Handles Button1.Click
'Remove the current items from the
dbiSched.Items
'This only removes them it doesn't
delete them from
'memory as they are stored in
myCollection
Me.DbiSchedule1.Items.Clear()
'Check if text box is empty - if it
is use the
'myCollection.ToArray to add the
items back to the schedule
'otherwise use a LINQ query to select
my filter.
If Me.TextBox1.Text
<> ""
Then
'A LINQ query using the
dbiSChedule.Item.Text.StartsWith
'You could modify this to apply to
the .Cargo, .Data, or .TAG easily
'for filtering by department,
building or warehouse for example
Dim schedQuery =
From SchedItem
As
Dbi.WinControl.Schedule.dbiScheduleItem
In myCollection _
Where SchedItem.Text.StartsWith(Me.TextBox1.Text)
_
Select SchedItem
'Using the results from the LINQ
query, add them to the dbiSched.Items
Me.DbiSchedule1.Items.AddRange(schedQuery.ToArray)
Else
Me.DbiSchedule1.Items.AddRange(myCollection.ToArray)
End
If
End
Sub
Back To The Top
|
LINQ|
.NET Framework|
LINQ.ToList |
|
| |
|
|
February 2009 |
|
| |
|
| Tech Tip
- Testing with Virtual PC 2007 |
|
For some time now,
especially in the COM world, deploying and testing has been a
bit of a chore. We here at DBI use Virtual PC 2007 (available
FREE from Microsoft
http://www.microsoft.com/downloads/details.aspx?FamilyID=04d26402-3199-48a3-afa2-2dc0b40a73b6&displaylang=en).
This allows us to test in XP/Vista/Server2003/Server2008 and
even the Windows7 Beta operating systems. For those that are on
the fence about this technology, it is truly our greatest
resource for testing. With base copies of clean OS installs, we
can customize each install to reflect various real world
scenarios (Vista UAC elevation Admin/Standard a breeze).
Basically for those not in the know, VirtualPC allows you to
host different OS s on a single machine (right now the
VirtualPC2007 can be run on 64bit machines but you are limited
to 32 bit Client OS s for testing, however the new HyperV Server
will allow 64 bit client installs). All the information for the
virtual machine is stored in a single harddrive file. You can
setup the virtual machines with undo disks which basically
allow you to test to your heart s content, then discard all the
changes thus reverting back to the clean state. I don t know
if I can emphasize enough the time saving benefits of this
mechanism. From your dev machine you can test your install, run
your app, clear out the changes, then rerun in a matter of
seconds. There are also Virtual Servers available which allow
you to access your Virtual Machines from a webpage interface
thus allowing you to have multiple testers or the ability to
work across a VPN to access your platforms. As always we like to
throw in some of the pitfalls we come across the biggest
performance gain we managed with the whole setup was to
drastically increase the RAM in my own development machine. I
went to a 64bit Vista install so I could access the extra RAM
then went with 8GIG of RAM, this way I can have multiple Virtual
Machines open at the same time as Wise for Windows,
VS2005/VS2008 and all the other bits and pieces that make up a
development machine. You can move files with shared folders or,
as I have, opt for the Virtual Machine Additions, which when
installed in the client OS, allow for seamless mouse integration
as well as file drag/drop functionality. As the technology is
free, we just thought a bit of an endorsement might help out
some of you in those deployment conundrums.
Back To The Top |
Virtual PC|
DBI|
COM|
Windows7|
Virtual Servers|
Vista|
64 Bit| |
|
| |
|
|
January 2009 |
|
| |
|
| Tech tip
ctDayView appointment sizing and selected styles. |
|
|
With the
new release of Studio Controls for COM (SCCOM), we added a new
control called ctDayView. This is a reworking of the original
ctMDay and ctDays with some new styles and many other fun
features. Today I m going to focus on the Selected Styles and
Appointment Moving and Sizing.
To
start with let s look at the SelectedAppStyle property. This
property allows us to show the selected appointment as either a
Vista Style or Standard (ctMDay) Style
In these images I have the TaskBar=True,
TaskBarWidth=10 and TaskBarColor=RGB(255,0,0). We left the
standard style in so that the original presentation can be
maintained, but the new Vista style looks a bit cleaner and more
modern.
Also,
we ve gotten a couple of more questions on the sizing and moving
of appointments in the ctDayView. This functionality did exist
in ctMDay but it s worth another look as the new styles can have
an effect on the moving and sizing.
This behavior is controlled by the
AppointMoveType property and can have a value of Standard or
Advanced.
With the Standard enum the appointment is
moved by clicking and dragging the top bar of an appointment,
and sized by clicking and dragging the bottom bar of an
appointment (bar for the Standard SelectedAppStyle, line for the
Vista SelectedAppStyle). This style is preferable for those with
TaskBars disabled.
With the Advanced enum the appointment is
moved by clicking and dragging the task bar of an appointment,
and sized by clicking and dragging the top or bottom bar (bar
for the Standard SelectedAppStyle, line for the Vista
SelectedAppStyle) of an appointment.
In our ctDayViewDemo.exe we have the
taskbarwidth set to 2 to showcase the appointment styles a bit.
This may require some finite mouse control some end-users aren t
comfortable with, so if this becomes an issue, increase the
taskbarwidth to give a larger grabbing area.

**A side note from the Technical Support
Department**
As always when we do a new release we like
to remind our clients that when coding with our controls, we
strongly recommend that you set the properties for the controls
in code whenever possible. As there are new releases of many
controls in the SCCOM and SCNET products, if you have set your
properties for the controls in code, then replacing existing
controls with newer versions is much easier as most IDE s allow
you to remove the old control and add the new version with the
same name and they will automatically map the existing code for
you. A few checks for event handlers and you are set.
Back To The Top
|
AppointMoveType|
SelectedAppStyle|
ctDayViewDemo|
TaskBarWidth|
SCCOM|
SCNET |
keywords provided by
www.Extractor.com
|
| |
|
|
November 2008 |
|
| |
|
| Tech Tip -
Extending objects with dictionaries |
|
|
Some of our older
products in the .NET environment may not have the .tag property
available on all the objects. Those objects usually have a
Cargo(String) or Data (Integer) property. What you can do to
leverage those with more generic objects is to create a
collection.dictionary which will store a key/value pair. You can
then create a unique ID and store your object in the dictionary
along with the unique ID. I usually use a guid and place that in
the Cargo property and at the same time add my object to the
collection here is a quick snippet of code
Partial Public Class MyObject
Public Name As String
Public Location As String
Public StaffID As Long
End Class
Public StaffInfo As New System.Collections.Generic.Dictionary(Of
String, Object)
Private Sub DbiSchedule1_BeforeTimeBarDrop(ByVal sender As
Object, ByVal e As
Dbi.WinControl.Schedule.BeforeTimeBarDropEventArgs) Handles
DbiSchedule1.BeforeTimeBarDrop
'Create a new guid to handle the record
keeping
Dim newGuid As String = System.Guid.NewGuid.ToString
e.TimeBarItem.Cargo = newGuid.ToString
'Add the guid to the Cargo property
e.TimeBarItem.Text = "Test"
e.TimeBarItem.End = e.TimeBarItem.Start.AddMinutes(90)
'Create my extended object, in this case
some extra staff info to attach to the timebar
Dim newObj As New MyObject
newObj.Name = "Paul"
newObj.Location = "Office 2A"
newObj.StaffID = 102
'Add the pair to my dictionary, now in
other timebar events, I can use the .item feature
'of the dictionary collection to get my object
StaffInfo.Add(newGuid, newObj)
e.AllowDrop = True
End Sub
Private Sub DbiSchedule1_TimeBarDoubleClick(ByVal sender As
Object, ByVal e As
Dbi.WinControl.Schedule.TimeBarDoubleClickEventArgs) Handles
DbiSchedule1.TimeBarDoubleClick
Dim curStr As String
'Get my staff object from my timebar
using the key stored
'in the Cargo property
Dim curObj As MyObject = StaffInfo.Item(e.TimeBarItem.Cargo)
curStr = "Text: " & e.TimeBarItem.Text & " Name: " & curObj.Name
& " Office: " & curObj.Location
MsgBox(curStr)
End Sub
Private Sub DbiSchedule1_AfterTimeBarRemoved(ByVal sender As
Object, ByVal e As
Dbi.WinControl.Schedule.AfterTimeBarRemovedEventArgs) Handles
DbiSchedule1.AfterTimeBarRemoved
'If I remove a timebar from the schedule,
I don't need the item in my dictionary.
StaffInfo.Remove(e.ScheduleItem.TimeBars(e.BarIndex).Cargo)
End Sub
This can actually be used anywhere you can
stick some text on an object, while I do prefer the inheritance
method of extending objects, that does require re-casting and
alternatives are never a bad idea, mayhap they can lead you to
your own timesaving concepts.
Back To The Top
|
.NET Enviroment|
.tag|
collection.dictionary|
unique ID |
keywords provided by
www.Extractor.com
|
| |
|
|
October 2008 |
|
| |
|
|
Tech Tip - Using dbiPIM to
keep multiple calendar controls synchronized |
|
|
As a developer I
find some of the features of our controls to be really exciting.
One of my newfound treasures with the release of Calendar Tools
3.0 for .NET is the ability to add my appointments to the common
PIM repository. We've had this feature in previous releases,
however at that time it was only used as a repository, it didn't
directly interact with other controls. Now we have the ability
to "attach" a dbiPIM control to several of our CalTools controls
(dbiDayView, dbiCalendar and dbiMonth). What this means then is
that during a data load, I only have to add my data to the PIM
object, this will then broadcast the objects to all the
controls. This also holds true for modifications and updates. So
for a quick example I'll walk through adding the PIM object to
the toolbox, then the form, then hooking in two controls
dbiDayView and dbiCalendar.
To add the
dbiPIM4.dll to the toolbox, right click a header in the toolbox,
select Choose Items, then click the browse button. By default
the base libraries are now in C:\DBITech\dbiBaseAssemblies,
select the dbiPIM4.dll and then click OK. Now simply drag that
dbiPIM control to the form you are working on, this will add the
dbiPIM to the ComponentTray in your form (default name is
DbiPIM1). As you can see in your property pages, this will allow
collections for Alarms, Appointments, Contacts, Locations and
Tasks. This information will be broadcast to all the controls we
hook up to the PIM object.
Hooking the
dbiPIM1 into the controls is pretty straightforward, on the
controls that support the dbiPIM object there is a property
called PIM, in this case I will go to the property designer for
dbiCalendar, go to the PIM property, click the dropdown and
select dbiPIM1, repeat for the dbiDayView control.
Now add an
appointment to the dbiDayView control by selecting a time range,
then typing. Once you tab off the appointment (this will commit
the appointment to the collection) the changes will be reflected
in the dbiCalendar. Now double click the appointment in the
dbiCalendar, change the text, and click save and exit. You will
see the changes reflected back to the dbiDayView control.
Back To The
Top
|
Calendar Tools 3.0 for .NET|
dbiMonth|
dbiCalendar|
dbiPIM|
dbiDayView|
Appointment|
PIM Object |
keywords provided by
www.Extractor.com
|
| |
|
|
September 2008 |
|
| |
|
| Tech Tip Property Pages in Demo Run-times |
|
|
Correction
from last month:
To help developers get
acquainted with some of the changes we have added, there is a
new feature to all of our .NET demo applications. You can
now click the view property page link in runtime and you
will open a modal form with the property pages for the Calendar
control in the demo. This way you can modify settings on
the fly and see the results immediately.
Back To The
Top
|
NET Demo|
Property Page Link|
Calendar Control|
Demo|
Property Pages |
|
| |
keywords provided by
www.Extractor.com |
|
August 2008 |
|
| |
|
| Tech Tip Calendar Tools 3.0 for .NET Property Pages in Demo Run-times |
|
To help developers get
acquainted with some of the changes we have added, there is a
new feature to all of our demo applications. You can now double
click the Solutions for .NET image in runtime and you will open
a modal form with the property pages for the Schedule in the
demo. This way you can modify settings on the fly and see
the results immediately.
Back To The Top |
|
| |
|
|
July 2008 |
|
| |
|
| Tech Tip
ctSchedule column header clicks and VFP API s |
|
I ve been working
with sorting in ctSchedule items. In order to capture which
column was clicked on, I had to think outside the box a bit, so
I thought this might be handy for those that needed it. To begin
with I created three columns and three colored triangle images
using solid colors. This is important because I basically use an
API to peek at the color under the mouse and use this
information to determine the column. This was done in VFP
because I wanted to try out API calls in FoxPro, VB6 is pretty
straightforward so I thought we d experiment a bit. To that end
add three images to the ctSchedule like so
Then add the images by setting the ctSchedule.ColumnPicture
property.
Here is the program portion, it includes the API function calls,
as well as a function to parse the results.
DECLARE Integer GetDC IN WIN32API Integer hndle
DECLARE Integer GetPixel IN win32api AS GetPixColor Integer hdc,
Integer nXPos, Integer nYPos
Declare Integer ReleaseDC IN WIN32API Integer hndle, integer hdc
_vfp.AutoYield=.F.
PUBLIC ColorArrow(3) as Integer
PUBLIC curX as Integer
PUBLIC curY as Integer
ColorArrow(1)=16711680 &&These are the colors of my triangles.
ColorArrow(2)=65280
ColorArrow(3)=8388736
SET PROCEDURE TO prgmain.prg
DO FORM form1 && Run the main form
FUNCTION CalcColumn(curColor as integer)
curCol=-1 && this is the default for not found see Click event
FOR x = 1 TO 3
IF curColor = ColorArrow(x) then
curCol = x
ENDIF
NEXT
RETURN curCol
ENDFUNC
Then in the Click event of the schedule, I call my function and
it will return the column used.
*** ActiveX Control Event ***
curHDC = GetDC(thisform.ctSched1.HWnd) &&Get the handle to the
schedule
clickCOL = CalcColumn(GetPixColor(curHDC, curX, curY)) &&Call my
function above using the x,y values set above.
IF clickCOL > -1 then
thisform.text1.Value = "Clicked Column " + STR(clickCOL)
ELSE
thisform.text1.Value = ""
ENDIF
ReleaseDC(thisform.ctSched1.hWnd,curHDC)
The curX and curY are set in the ctSched.MouseMove event
*** ActiveX Control Event ***
LPARAMETERS button, shift, x, y
&&Set the curX and curY for use in the Click event
curX = x
curY = y
After that, I can clear my schedule and reload the data with the
new sort in place, and if I want to get fancy I can even flip my
images. The only caveat (I know there is always a caveat with
the techtips) is that you have to use solid colors for the
triangles that aren t used elsewhere in the schedule or you ll
get some sorts when you click on a timeline or other area with
the same colors.
Back To The Top |
Images|
Caveat|
Sort|
Schedule|
API|
Solid Colors|
Triangle|
Timeline|
TechTips|
Reload|
VB6|
FoxPro|
Sorting |
keywords provided by
www.Extractor.com
|
| |
|
|
June 2008 |
|
| |
|
|
Tech Tip ctMday all day ellipse click, .NET combo box by
enumerator and Intellisense in MSAccess 2003/2007 ActiveX |
|
| |
|
|
Hello and welcome to this week s DBI Tech
Tips, since we are having a two-for promotion we thought we d
toss in a two-for tip
For the COM developers out there, we have
been asked how to trap the ellipse click in ctMday. By itself,
the control just shows the ellipse to indicate that there are
more all day appointments than are visible in the column. To
that end, it was never intended to be clicked on, we always
thought a whiteboard type approach with a listbox was within the
domain of the developers. We ve had some requests wherein people
want to throw a dialog with a listbox or a custom tree view for
that particular area when the ellipse is clicked.
So we put some ideas to the task and
discovered that we can use the internal drag/drop methods/events
to capture when the all day area has been clicked, but not on an
appointment. Here is the code in vb6
Dim booIsDragDrop As Boolean 'Used to
indicate wether or not we are in true drag/drop mode.
Dim curX As Integer
Dim curY As Integer
Private Sub ctMDay1_MouseDown(Button As
Integer, Shift As Integer, x As Single, y As Single)
booIsDragDrop = False 'Set the
booIsDragDrop to false, in case we are using actual drag/drop
code
Me.ctMDay1.DragDrop x /
Screen.TwipsPerPixelX, y / Screen.TwipsPerPixelY 'Fire the
drag/drop event to get the current position in the control
End Sub
Private Sub ctMDay1_MouseMove(Button As
Integer, Shift As Integer, x As Single, y As Single)
'Use the mousemove to capture the current
x/y of the mouse
'for use in the appoinmentat function in
DropList
curX = x / Screen.TwipsPerPixelX
curY = y / Screen.TwipsPerPixelY
End Sub
Private Sub ctMDay1_DropList(ByVal nIndex
As Integer, ByVal nTime As Integer, ByVal nColumn As Integer)
If booIsDragDrop = False Then
Me.Label1.Caption = CStr(nIndex)
If nIndex = -1 And
Me.ctMDay1.AppointmentAt(curX, curY) = 0 Then
'Enter code here to throw a listbox or custom dialog listing all
the allday appts.
MsgBox "This is an ellipse or a blank area of allday for col:" &
CStr(nColumn)
End If
Else
'Do our actual drag/drop
code
End If
booIsDragDrop = True 'Set the default in
case an actual drag/drop fires.
End Sub
And for our .NET
users we came across an interesting use of the enum class for
setting default items in a combo box. Basically you use the
gettype and getValues methods inherited by all enums to bind the
enum to the combo box. So with two lines of code, we can bind
our dbi.enumFillType to a combobox and set the enum on a control
as the value in the combo box changes. Here is a quick sample
Private
Sub Form1_Load(ByVal
sender As System.Object,
ByVal e
As System.EventArgs)
Handles
MyBase.Load
Me.comboFillType.DataSource =
System.Enum.GetValues(GetType(Dbi.enumFillType))
End
Sub
Private
Sub
comboFillType_SelectedIndexChanged(ByVal
sender As System.Object,
ByVal e
As System.EventArgs)
Handles
comboFillType.SelectedIndexChanged
Me.dbiLabel1.FillType =
Me.comboFillType.SelectedValue
End
Sub
Back To The
Top
|
Ellipse|
Bind|
Methods/Events|
Listbox|
Appointments|
Control|
Developers|
ComboBox|
New Users|
Internal Drag Drop/Methods|
Custom Tree|
ctMDay |
keywords provided by
www.Extractor.com
|
| |
|
|
May 2008 |
|
| |
|
| Tech Tip Synchronizing dbiDayView to dbiSchedule |
|
We often get questions here
asking about the best way to synchronize a
schedule to a dayview. In this edition of the
techtip we ll make a start by hooking together a
couple of events in a dbiSchedule and dbiDayView.
One item of note, before you can use
Solutions::Schedule 2.0 of .NET you will need to
update your Calendar Tools for .NET to 2.5. In
the sample code below, by hooking the
AfterAppointmentAdd event to the creation of
timebars, we would eliminate the need to load
the schedule and the dayview independently. By
adding an item to the DayView, it gets added to
the Schedule. You can take this example further
by hooking in dragdrop and data access. Right
now it s pretty simple, if you have a dbiDayView
and dbiSchedule on a form like so
You can use the following
code to do the following
Add
an appointment to the dbiDayView and it will add
it to Office300 on the dbiSchedule
Change the start/end times of an appointment in
the dbiDayView and it will be reflected in the
dbiSchedule
Move
and appointment in dbiDayView and it will move
in dbiSchedule
Move
a timebar in dbiSchedule and it will be
reflected back to the appointment
Change the size of a timebar in dbiSchedule and
it will change the appointment in dbiDayView
Dim
booleanTimeBarChanged
As Boolean
= False
' Used so we don't
fire a change event when changing dayview via
code
Private
Sub
DbiDayView1_AfterAppointmentAdd(ByVal
sender As
Object,
ByVal e
As
Dbi.WinControl.DayView.AfterAppointmentAddEventArgs)
Handles
DbiDayView1.AfterAppointmentAdd
Dim newTimebar
As
New
Dbi.WinControl.Schedule.dbiTimeBarItem
e.Appointment.Data = 300
'Used for finding the
classroom
With
e.Appointment
newTimebar.Text = .Text
newTimebar.Start = .Start
newTimebar.End = .End
newTimebar.EntryID =
System.Guid.NewGuid.ToString
'This is for tracking
the timebar in other events
'Ordinarily this
would be the database record ID
newTimebar.Tag = e.Index
'Add the appointment
index to the tag so we can manipulate it in
other events
End
With
Dim curItem
As
New
Dbi.WinControl.Schedule.dbiScheduleItem
curItem = FindItemInSched(e.Appointment.Data)
If
Not (curItem
Is
Nothing)
Then
curItem.TimeBars.Add(newTimebar)
e.Appointment.Cargo = newTimebar.EntryID
' Add the timebar ID
to the cargo so we can manipulate it in other
events
End
If
Me.DbiSchedule1.Invalidate()
End
Sub
Private
Sub
DbiDayView1_AfterAppointmentChange(ByVal
sender As
Object,
ByVal e
As
Dbi.WinControl.DayView.AfterAppointmentChangeEventArgs)
Handles
DbiDayView1.AfterAppointmentChange
If
Not (booleanTimeBarChanged)
Then
Dim
curSchedItem As
Dbi.WinControl.Schedule.dbiScheduleItem
Dim curTimebar
As
Dbi.WinControl.Schedule.dbiTimeBarItem
Dim
foundTimebar As
New
Dbi.WinControl.Schedule.dbiTimeBarItem
curSchedItem = FindItemInSched(e.Appointment.Data)
For
Each curTimebar
In
curSchedItem.TimeBars
If
curTimebar.EntryID = e.Appointment.Cargo
Then
foundTimebar = curTimebar
Exit
For
End
If
Next
foundTimebar.Start = e.Appointment.Start
foundTimebar.End = e.Appointment.End
foundTimebar.Text = e.Appointment.Text
foundTimebar.Tag = e.Index
Else
booleanTimeBarChanged =
False
End
If
Me.DbiDayView1.Refresh()
End
Sub
Private
Sub
DbiSchedule1_AfterTimeBarMoved(ByVal
sender As
Object,
ByVal e
As
Dbi.WinControl.Schedule.AfterTimeBarMovedEventArgs)
Handles
DbiSchedule1.AfterTimeBarMoved
Dim curAppt
As
Dbi.WinControl.DayView.dbiDayAppointmentItem =
Me.DbiDayView1.Appointments(e.TimeBarItem.Tag)
booleanTimeBarChanged =
True
curAppt.Start = e.TimeBarItem.Start
curAppt.End = e.TimeBarItem.End
curAppt.Text = e.TimeBarItem.Text
booleanTimeBarChanged =
False
Me.DbiDayView1.Invalidate()
End
Sub
Private
Sub
DbiSchedule1_AfterTimeBarSized(ByVal
sender As
Object,
ByVal e
As
Dbi.WinControl.Schedule.AfterTimeBarSizedEventArgs)
Handles
DbiSchedule1.AfterTimeBarSized
Dim curAppt
As
Dbi.WinControl.DayView.dbiDayAppointmentItem =
Me.DbiDayView1.Appointments(e.TimeBarItem.Tag)
booleanTimeBarChanged =
True
curAppt.Start = e.TimeBarItem.Start
curAppt.End = e.TimeBarItem.End
curAppt.Text = e.TimeBarItem.Text
booleanTimeBarChanged =
False
Me.DbiDayView1.Invalidate()
End
Sub
Private
Sub
DbiDayView1_AppointmentTextChange(ByVal
sender As
Object,
ByVal e
As
Dbi.WinControl.DayView.AppointmentTextChangeEventArgs)
Handles
DbiDayView1.AppointmentTextChange
If
Not (booleanTimeBarChanged)
Then
Dim
curSchedItem As
Dbi.WinControl.Schedule.dbiScheduleItem
Dim curTimebar
As
Dbi.WinControl.Schedule.dbiTimeBarItem
Dim
foundTimebar As
New
Dbi.WinControl.Schedule.dbiTimeBarItem
curSchedItem = FindItemInSched(Me.DbiDayView1.Appointments(e.Index).Data)
For
Each curTimebar
In
curSchedItem.TimeBars
If
curTimebar.EntryID =
Me.DbiDayView1.Appointments(e.Index).Cargo
Then
foundTimebar = curTimebar
Exit
For
End
If
Next
foundTimebar.Start =
Me.DbiDayView1.Appointments(e.Index).Start
foundTimebar.End = Me.DbiDayView1.Appointments(e.Index).End
foundTimebar.Text = Me.DbiDayView1.Appointments(e.Index).Text
foundTimebar.Tag = e.Index
Else
booleanTimeBarChanged =
False
End
If
Me.DbiDayView1.Refresh()
End
Sub
Private
Function
FindItemInSched(ByVal
intItemData As
Integer)
As
Dbi.WinControl.Schedule.dbiScheduleItem
'Function to find a
dbiScheduleItem based on it's Data property.
Dim findItem
As
Dbi.WinControl.Schedule.dbiScheduleItem
Dim foundItem
As
New
Dbi.WinControl.Schedule.dbiScheduleItem
For
Each findItem
In
Me.DbiSchedule1.Items
If
findItem.Data = intItemData
Then
foundItem = findItem
Exit
For
End
If
Next
Return
foundItem
End
Function
This is just the beginning
of what you can accomplish with a handful of
properties and events. You can add validation,
data access, and custom dialogs to create a
truly integrated application.
Back To The Top |
dbiSchedule|
dbiDayView|
Appointment|
Timebar|
Hooking|
Schedule|
DayView|
Data Access|
Validation|
Start\End Times|
DragDrop|
Load|
AfterAppointment
Add Event|
Calendar Tools |
keywords provided by
www.Extractor.com
|
| |
|
|
April 2008 |
|
| |
|
|
TechTip -
Transparency Tips, Tricks and Traps |
|
|
In this space we
usually try and focus on DBI controls or some non-standard ways
to do specific things with our controls. Yours truly has
been doing some dev work lately on internal systems and I came
across an interesting dilemma. So, today is going to be a bit
different, we're going to focus on a particular issue common to
most controls in a WinForm environment.
Here's where we begin - I wanted to add a fade-fill effect to my
WinForm background. Ok says I, I have the web, this should be
no problem . I did some research and came up with a few ways to
add fade-fill effects (custom 2d pens, fills, backimage
properties and onPaint overrides yikes, my screen was jittering
along like a June bug). So I thought to myself, I ll just toss
a dbiLabel on my form, dock it to fill and set a gradient fill,
presto in no time I had a nice looking form. There's a trap
though, any control that supports transparency will go
transparent to the container (form, container, tabpage) but not
other controls within the container.
Well that was something I thought a bit
more about. What if I had a label that sits overtop of a textbox
or an image. I set the backcolor to transparent and
instant grey box. What I needed was a little routine that would
take two controls and set the backimage of the topmost to the
image behind it. So I made this little function, it basically
takes a copy of the display of one control and slaps it into the
backimage of the topmost control. The only caveat (trick) is
that the control being the topmost control has to support a
backimage property. This can also be used at the form level as
the form is a container control. Keep in mind there isn t a lot
of error checking, just something to toss out there for perusal.
Private Sub FormLoad(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
SetBackimage(Me, Me.Button1)
End Sub
Private Sub SetBackimage(ByRef ctrlColor As Control, ByRef
ctrlTransparent As Control)
Try
Dim intX As Integer
Dim intY As Integer
intY = ctrlTransparent.Top - ctrlColor.Top
intX = ctrlTransparent.Left - ctrlColor.Left
If intY > 0 And intX > 0 Then
Dim curImage As New Bitmap(ctrlColor.Width, ctrlColor.Height)
ctrlColor.DrawToBitmap(curImage, New Rectangle(0, 0,
ctrlColor.Width, ctrlColor.Height))
ctrlTransparent.BackgroundImage = curImage.Clone(New _
Rectangle(intX, intY, ctrlTransparent.Size.Width,
ctrlTransparent.Size.Height), _
Imaging.PixelFormat.Format24bppRgb)
End If
Catch ex As Exception
End Try
End Sub
Back To
The Top
|
Control|
Container|
BackImage Properties| FadeFill Effect| WinForm|
Tabpage|
Gradient|
Dock|
dbiLabel| |
keywords provided by
www.Extractor.com
|
| |
|
|
March 2008 |
|
| |
|
|
TechTip -
dbiExplorerBar MultiColumn effects |
|
|
Hello all you developer types. Today s topic is going to be
about dbiExplorerBar and ways to achieve a multicolumn approach.
One of the most unique features of the control is the multiple
layouts available out of the box. The navigation style
which looks like so
Can be used to house a default
multicolumn view, which is configured by setting the
dbiExplorerBar.ControlType = enumControlType.Navigation, the
dbiExplorerBar.MultiColumn = True and the
dbiExplorerBar.ColumnSize = width of column. With those settings
you simply add items to the control and they get laid out in a
nice table-type view.
Now to extend that
even further, we often are asked how you can mix the types. For
example say I want an explorer style with multiple columns. Well
that is pretty easy as well, as the explorer type of the control
allows for panels which can host other controls such as tables,
lists and even images. I used the image technique in the
upcoming SmartClient demo (image on the right) to show that it
is not only possible, but quite easy to manage
On the right, I get the full benefits of the explorer style
(note the multi-column list, the standard list, then the
multicolumn image list at the bottom). This allows for a cleaner
more customizable and attractive workspace (ok don t beat me up
on the color scheme, I am looking forward to the Expressions
products so the marketing folks can take the heat for the look
and feel, I ll stick to the coding). Feel free to poke around
the demo and see what you can do with dbiExplorerBar.
Smart
Client Demo's
Back To The Top
|
Lists|
Explorer Style| Multicolumn| dbiExplorerBar| SmartClient
Demo|
Host|
Multiple Columns| Navigation Style| Multiple Layouts|
Unique Features| Panels| |
keywords provided by
www.Extractor.com
|
|
February 2008 |
|
| |
|
| Tech Tip
RegFree COM and DBI Components |
|
|
Good afternoon loyal readers. We have noticed a pretty good
trend here in our COM product sales, which has led to more
questions on the deployment side of things. As such I thought
I d delve into an interesting but often overlooked method of
deploying ActiveX controls with applications. It s called
RegFree COM. That s right, as the name implies it removes the
need to RegSvr COM .ocx files or register them during
deployment. This allows greater flexibility in how you deploy
your projects. This has an impact especially with the Vista UAC
and registry lockdowns across networks. The process is pretty
straightforward, you build a .manifest file for your application
that contains all the information needed to call your .ocx
files. Here is the breakdown you will need an IDE that will
compile down to an executable in order to attach the manifest.
In our sample below we will simply use the method for including
the .manifest file with the application.exe, but there are ways
to build the manifest into the actual executable. For more
information on that do a google on MT.exe and manifest. |
Executables|
Registry|
Deployment|
OCX Files|
Regsvr|
XML|
BIN|
App Path|
OLE View|
GUIDS|
OLE Control|
IDE|
Visual Studio|
RegFree|
Type LIB|
Controls|
Manifest| |
Basically you can point the executable you are running to the
OLE control you want to use and specify the GUIDS for the
TypeLib and Class in the manifest thus eliminating the need to
check the registry (you can do a quick google on RegFree COM for
more of the backstory) and I'll focus on how you can set one up
to use some of our controls. As you are going to need both the
typelib ID and class ID you may want to trackdown a copy of
OLEVIEW. That little tool shipped back with VisualStudio 6 (I
think it may actually go back to 4) but you can find a copy
here...
http://www.microsoft.com/downloads/details.aspx?familyid=5233b70d-d9b2-4cb5-aeb6-45664be858b6&displaylang=en
So basically let s start a small sample app for testing
purposes... we'll toss ctList on a form there and call our app
ctListTest.exe
Add a couple of node items in the firstdraw and build your app.
Now let s copy our ctList.ocx to a folder in your app path
called bin. We are then going to create a file called
ctListTest.exe.manifest in the same folder as the executable.
You can also check out some articles on building the manifests
into the executables, there are a couple of command line
utilities available from Microsoft that will handle this, but
for our example we are going to use the "deploy with executable"
method. The XML is going to look like so...
<?xml version="1.0" encoding="utf-8"?>
<assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1
assembly.adaptive.xsd" manifestVersion="1.0"
xmlns:asmv1="urn:schemas-microsoft-com:asm.v1"
xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"
xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity name="ctDate.exe" version="1.0.0.0"
type="win32" />
<file name="bin\ctDate.ocx" asmv2:size="118784">
<typelib tlbid="{F5A21BA6-2C08-11D5-A85D-0080C8DFC881}"
version="5.0" helpdir="" resourceid="0" flags="HASDISKIMAGE"
/>
<comClass clsid="{F5A21BA6-2C08-11D5-A85D-0080C8DFC881}"
threadingModel="Apartment" tlbid="{F5A21BA6-2C08-11D5-A85D-0080C8DFC881}"
progid="ctDATE.ctDateCtrl.5" description="ctDate Control" />
</file>
</assembly>
Now you can see we have a single <file> tag in our XML, you can
have as many as you need to define for your app. Notice this one
is for ctDate, we are going to mod it for use with ctList by
changing the tag properties as follows...
This info is from the actual exe file properties...
-orig-<assemblyIdentity name="ctDate.exe" version="1.0.0.0"
type="win32" />
-new-<assemblyIdentity name="ctListTest.exe" version="1.0.0.0"
type="win32" />
Now for the OCX part...
-orig-
<file name="bin\ctDate.ocx" asmv2:size="118784">
<typelib tlbid="{F5A21BA6-2C08-11D5-A85D-0080C8DFC881}"
version="5.0" helpdir="" resourceid="0" flags="HASDISKIMAGE"
/>
<comClass clsid="{F5A21BA6-2C08-11D5-A85D-0080C8DFC881}"
threadingModel="Apartment" tlbid="{F5A21BA6-2C08-11D5-A85D-0080C8DFC881}"
progid="ctDATE.ctDateCtrl.5" description="ctDate Control" />
</file>
-new-
<file name="bin\ctList.ocx" asmv2:size="471040">
<typelib tlbid="{38EC7E50-6A01-4727-88E7-47788ABD54FE}"
version="6.0" helpdir="" resourceid="0" flags="HASDISKIMAGE"
/>
<comClass
clsid="{2B447B04-4CDC-4F52-915C-694DDCAD79F4}" threadingModel="Apartment"
tlbid="{38EC7E50-6A01-4727-88E7-47788ABD54FE}" progid="ctLIST.ctListCtrl.6"
description="ctList Control 6.0" />
</file>
So your XML text for the ctList will be...
<?xml version="1.0" encoding="utf-8"?>
<assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1
assembly.adaptive.xsd" manifestVersion="1.0"
xmlns:asmv1="urn:schemas-microsoft-com:asm.v1"
xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"
xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity
name="ctListTest.exe" version="1.0.0.0" type="win32" />
<file name="bin\ctList.ocx" asmv2:size="471040">
<typelib tlbid="{38EC7E50-6A01-4727-88E7-47788ABD54FE}"
version="6.0" helpdir="" resourceid="0" flags="HASDISKIMAGE"
/>
<comClass clsid="{2B447B04-4CDC-4F52-915C-694DDCAD79F4}"
threadingModel="Apartment" tlbid="{38EC7E50-6A01-4727-88E7-47788ABD54FE}"
progid="ctLIST.ctListCtrl.6" description="ctList Control 6.0" />
</file>
</assembly>
If you wish to test this on your dev machine, you'll have to
regsvr32/u ctList.ocx (in your CT7 install folder) then if
you did everything right your app should run as normal, rename
the ctListTest.exe.manifest to something else and run it and you
should get a class unregistered error.
|
keywords provided by
www.Extractor.com |
|
Back To The Top |
|
| |
|
|
January 2008 |
|
| |
|
| Tech Tip #1 Solutions::Schedule 2.0 for .NET view new features quickly
and easily with Smart Client |
|
|
As you have
no doubt heard by now SS.NET 2.0 has been released and we want
you to be able to see some of the awesome new features available
quickly and easily. To that end we have released 7 demos
available as SmartClient demo applications. To download these,
you will need .NET Framework 2.0 and MS Internet Explorer 6
or later. They will install in the download sandbox so you
don t have to worry about having Solutions::Schedule 1.0 for
.NET or Solutions::Schedule 1.5 for .NET installed, you can run
these applications just by clicking the links. Oh and the links
can be found here
http://www.dbi-tech.com/SmartClientSamples.asp
Also don t forget our last tech tip (#2
below), the double clicking of the logo will still open the
property pages so you can tweak away to your heart s content
|
Schedule|
Designer|
XML Read|
XML Write| Productions Cycle|
Modal Form|
.NET Framework| SmartClient Demo| |
keywords provided by
www.Extractor.com
|
|
Tech Tip #2 Solutions::Schedule 2.0 for .NET Property Pages in Demo
Run-times
Solutions::Schedule 2.0 for .NET is now in release. This is a
huge step forward in both the presentation and organization of
the Schedule. To help get you acquainted with some of the
changes we have added, there is a new feature to all of our demo
applications. This way you can modify settings on the fly and
see the results immediately. Just wanted to let people know
about this as we used this feature a fair bit in the production
cycle to test and adjust things without having to hardcode
everything. Oh and the tip part if you get the schedule setup
just right, you can use the XMLWrite in the property page to save your work, then simply use the XMLRead in the designer to load your work into your own Schedule.
Back To The Top
|
|
| |
|
|
December 2007 |
|
| |
|
| Tech Tip
Solutions::Schedule 2.0 for .NET Property pages in demo
runtimes |
|
|
Well to start with, I d like to wish
everyone a happy holiday season and a very prosperous new year.
As you will have noted if you read any of the above information,
SolSched 2 for .NET is now in release. This is a huge step
forward in both the presentation and organization of the
Schedule. Just wanted to let people know about this as we
used this feature a fair bit in the production cycle to test and
adjust things without having to hardcode everything. Oh and the
tip part if you get the schedule setup just right, you can use
the XMLWrite in the property page to save your work, then
simply use the XMLRead in the designer to load your work into
your own Schedule.
Back To The
Top
|
Schedule|
Load|
Designer|
XML Read|
XML Write|
Schedule Setup| Production Cycle|
Modal Form|
.NET Image|
Demo Applications| |
|
| |
keywords provided by
www.Extractor.com |
|
November 2007 |
|
| |
|
| Tech Tip
Defaulting the List (in both dbiList and dbiSchedule.NET) |
|
|
One of the more frequent questions we get
here in the support department regards manipulation of the list
in dbiSchedule (as well as the new dbiList) and why does the
developer have to do so much of the initialization work
themselves. And the answer to that would be in the flexibility
of the list itself. As it is a dynamic list/treeview control
unto itself, there can be many permutations of headers, parent
nodes, child nodes, graphics and formatting. One of the ways to
set this is to define these properties in the data load, and
that is perfectly legitimate, but there may be a better way.
Once again we are going to hit on one of my best programming
buddies you faithful readers know what s coming next
Inheritance. I was recently asked to put together a sample
showing how to use a header / child relationship in a restaurant
setting. As I began my coding I found myself defining the header
dbiScheduleItem on the data load. I was iterating through my
list and using a couple of case statements then setting up my
items that way. I didn t like that. I am a simplified kind of
programmer. I like reusable code and I love my collections and
inheritance. So I thinked a bit and decided what I
wanted was more akin to a Microsoft Word type style. I wanted a
Header type node where I could set up some fancy fill effects.
But I wanted to make it easy to change the backcolor by
department. Then I wanted my Standard list items which I wanted
to pizzazz up a bit. So I put together my own partial classes
that directly inherited the dbiScheduleItem then set the
properties that I wanted. After that instead of coding each item
as a new dbi.WinControl.Schedule.ScheduleItem or
Dbi.WinControl.dbiNodeItem, I declare a new MyClass. Here is a
bit of the code to achieve this
Partial
Public
Class ItemHeaderDefault
Inherits
Dbi.WinControl.Schedule.dbiScheduleItem Or
Dbi.WinControl.dbiNodeItem
Public
Sub
New(ByVal Text
As
String)
Me.Text = Text
Me.BackColor = Color.FromArgb(0,
102, 118)
Me.BackColorTo = Color.FromArgb(0,
102, 118)
Me.FillType =
Dbi.enumFillType.Vertical
Me.Font =
New Font("Lucida
Sans", 9, FontStyle.Bold)
Me.ForeColor = Color.White
Me.Header =
True
End
Sub
End
Class
Partial
Public Class
ItemDefault
Inherits
Dbi.WinControl.Schedule.dbiScheduleItem Or
Dbi.WinControl.dbiNodeItem
Public
Sub
New(ByVal Text
As
String)
Me.Text = Text
Me.BackColor = Color.FromArgb(235,
222, 132)
Me.BackColorTo = Color.FromArgb(251,175,93)
Me.FillType =
Dbi.enumFillType.VerticalEdge
Me.Font =
New Font("Lucida
Sans", 9, FontStyle.Regular)
Me.ForeColor = Color.FromArgb(0,
102, 118)
End
Sub
End
Class
Now to utilize these I instance my own
Classes then add those items to the Schedule
Dim Head1
As
New ItemHeaderDefault("Kitchen")
Head1.BackColor = Color.White
Head1.BackColorTo = Color.LightGray
Dim Head2
As
New ItemHeaderDefault("Bar")
Head2.BackColor = Color.White
Head2.BackColorTo = Color.LightBlue
Dim Head3
As
New ItemHeaderDefault("WaitStaff")
Head3.BackColor = Color.White
Head3.BackColorTo = Color.PaleGreen
Dim Kim
As
New ItemDefault("Kim")
Dim David
As
New ItemDefault("David")
Dim Jeff
As
New ItemDefault("Jeff")
Dim Katlyn
As
New ItemDefault("Katlyn")
Dim Shelly
As
New ItemDefault("Shelly")
Dim Clark
As
New ItemDefault("Clark")
Dim William
As
New ItemDefault("William")
Dim Janine
As
New ItemDefault("Janine")
Dim Paul
As
New ItemDefault("Paul")
Head1.Items.Add(Kim)
Head1.Items.Add(David)
Head1.Items.Add(Jeff)
Head2.Items.Add(Katlyn)
Head2.Items.Add(Shelly)
Head2.Items.Add(Clark)
Head3.Items.Add(William)
Head3.Items.Add(Janine)
Head3.Items.Add(Paul)
Me.DbiSchedule1.Items.Add(Head1) or Me.DbiList1.Items.Add(Head1)
Me.DbiSchedule1.Items.Add(Head2) or Me.DbiList1.Items.Add(Head2)
Me.DbiSchedule1.Items.Add(Head3) or Me.DbiList1.Items.Add(Head3)
Head1.Expand()
Head2.Expand()
Head3.Expand()
As you can see the inheritance allows me to
set those properties in one place and modifying the items is
then pretty straightforward when the end-user comes back and
doesn t like that particular shade of yellow.
If you need
any clarification don t hesitate to drop us a line at
support@dbi-tech.com or hit our webpage for some support at
http://www.dbi-tech.com/Support/Default.aspx
Back
To The Top
|
Inheritance| dbiScheduleItem|
Data Load|
Child|
End-User|
Declare|
MyClass|
Back Color|
Iterating|
Child Relationship| |
keywords provided by
www.Extractor.com
|
| |
|
|
October 2007 |
|
| |
|
| Tech Tip - Extend
the Time Frame with Solutions::Schedule .NET |
|
| Howdy folks, today s
tip highlights how to manipulate the schedule to utilize an
extended time frame (or conversely a smaller time frame, such as
microseconds). The core of the work is processed by the two
functions, we merely call each as needed to add/manipulate the
schedule, then pull the information back to a data-aware state
for database updates using the second function. We will be
releasing this as a demo application with the
Solutions::Schedule.NET V2.0.
5 year schedule plan proxied on a 5 day
schedule!
With this view the user will see a 5 year
schedule.
Smallest increment will be equal to one
month.
There will be 12 minor increments per year
When using value point
Schedule will be 5 days and the time type
will be days
Conversion =
1 day schedule = 1 year actual
2 hour schedule = 1 month actual
To create the algorythm to get the desired
results
we used the following formula
month
position of increment Math calculation
hours
Jan
1
poi - 1 * 2 = 0
Feb
2
poi - 1 * 2 = 2
Mar
3
poi - 1 * 2 = 4
Apr
4
poi - 1 * 2 = 6
May
5
poi - 1 * 2 = 8
and so on
11 1
1 2 3 4 5 6 7 8 9 10 12
Position of increment
J F M A M J J A S O N D J
|
| These are the major time lines in the schedule
|_|_|_|_|_|_|_|_|_|_|_|_| This is the
minor time line in the schedule
To achieve this I used the following
RulerDivisions = 12;
and
GridFrequency = 10;
and
this.dbiSchedule1.TimeDistance = 120;
and
this.dbiSchedule1.SnapToGrid = true;
Please note that using snap to grid
requires that
the above properties are set by a common
factor
by this we mean that the time distance can
evenly be divided by ruler divisions and
the grid frequency
We used the following 2 functions to
either turn the date
of the schedule into our 5 year date
selection
or turn the 5 year selection into the
actual time
private DateTime Actual2Schedule(DateTime actualDate)
Actual2Schedule
{
DateTime schedDate;
schedDate = SchedStart.AddDays(actualDate.Year - SchedStart.Year).AddHours((actualDate.Month
- 1) * 2);
return schedDate;
}
private DateTime Schedule2Actual(DateTime schedDateTime)
Schedule2Actual
{
DateTime actDate;
actDate = SchedStart.AddYears(schedDateTime.Day - 1).AddMonths(schedDateTime.Hour
2);
return actDate;
}
When adding time bars to the schedule
you need to convert them into the proxied
time of the schedule
We did this as follows
Dbi.WinControl.Schedule.dbiTimeBarItem x;
declaring the new item
Dbi.WinControl.Schedule.dbiScheduleItem newItem = new
Dbi.WinControl.Schedule.dbiScheduleItem();
setting the item text in the list
newItem.Text = "Test 1";
declaring the new timebar item
x = new Dbi.WinControl.Schedule.dbiTimeBarItem();
x.Start = Actual2Schedule(System.DateTime.Parse("Jan 4
2007"));// setting the start time for the time bar
x.End = Actual2Schedule(System.DateTime.Parse("March 12 2008"))
;//setting the end time for the time bar
x.Text = Schedule2Actual(x.Start).ToString("MMM yyyy") + " to "
+ Schedule2Actual(x.End).ToString("MMM yyyy");
newItem.TimeBars.Add(x);adding the timebar to the item
this.dbiSchedule1.Items.Add(newItem);// adding the complete item
to the schedule
When working with timebars, the schedule
will think that you are working
with current time schedule times and not
the proxied time so you must
remember to convert the time bars to that
of the 5 year plan schedule or
you will have issues
private void
dbiSchedule1_AfterTimeBarMoved(object sender,
Dbi.WinControl.Schedule.AfterTimeBarMovedEventArgs e)
{
e.TimeBarItem.Text = Schedule2Actual(e.TimeBarItem.Start).ToShortDateString();
}
A special thanks goes out to our support
staff Jeff D. and Alan S. for this novel and powerful code
snippet.
Back To The
Top
|
Schedule|
Proxied Time|
Time Bars|
Grid|
Increment|
Time Frame|
Plan Schedule| Timebars|
Grid Frequency|
Ruler Divisions|
Time Distance|
Snap|
Algorithm|
Second Function| Database Updates| Utilize|
Manipulate| |
keywords provided by
www.Extractor.com
|
| |
|
|
September 2007 |
|
| |
|
|
Tech
Tips - Component Toolbox for .NET Helpfile and Toolbox
Registration |
|
Hello
programming type people. As you may have noticed elsewhere in
this edition of the Developer Bulletin we have released a new
product called Component Toolbox for .NET R2. This release we
have added some new features to both the helpfile system and we
also added an application that runs during install (and can be
run from the Start menu as well) that will register the
components into the VS2005 toolbox automatically. We'll break
down some of the features so you can take a peek for yourselves
when you download the free trial.
HelpFile Enhancements
---------------------
- Context-sensitive help in the VS2005 design environment. You
can access these by hitting F1 in the code editor after a method
name or property, as well as by hitting F1 while in a
property/event edit box in the form designer.
- For those who prefer the help 2.0 system, we have added a DBI
help namespace which will list all of our products and we add a
filter that will focus on the DBI product line.
- Better linking and hierarchal roadmaps particularly in our
marquee components (dbiList, dbiExplorerBar).
- Automatic registration of the 2.0 helpfiles.
- We still provide the help 1.0 .chm files available from the
start menu under Start Menu\Programs\DBI Technologies\Component
Toolbox .NET v2.0\Help Files (.chm)
VS2005 Toolbox Registration
---------------------------
- We now create a toolbox tab called DBI CT.Net and create the
toolbar items for our components in VS2005.
- We add a registry key that tells VS2005 to look in the install
folder for the supporting libraries of our components so we no
longer need to have our .DLL's in the GAC in order to use them.
You can add them there manually if you prefer.
DBIInstall
----------
- This is the application we designed to handle the helpfile
registration and toolbox registrations. This app is run from the
install and will also be called in Remove mode if you uninstall
our components (through add/remove or re-running the
installation .exe). You can also run this application in either
mode from the shortcuts Start Menu\Programs\DBI
Technologies\Component Toolbox .NET v2.0
- Running the application in Remove mode will remove the toolbox
entries, the helpfile registrations, and also the registry key
to locate the supporting .DLL's.
Back To The Top |
Toolbox|
Help File|
Install|
DBI|
Registry Key| Supporting|
Toolbox Entries|
EXE|
GAC|
Supporting Libraries|
Install Folder| dbiExplorerBar| Hierarchal Roadmaps|
Filter| |
keywords provided by
www.Extractor.com
|
| |
|
|
July 2007 |
|
| |
|
| Tech Tip -
Compiling 32 bit applications on 64 bit machines |
|
One of
the cool features of Visual Studio 2005 is its ability to
compile code for various platforms, 32bit
XP, 64bit Vista, it's all there for the taking. However certain
issues may arise when trying to use our
controls in 64 bit environments. Certain low level API's are
really finicky about the type of the integer
being passed, most notably in printing and screen draw routines.
"But I just build my app and it works on
both 32 bit and 64 bit machines, and if it doesn't support 64
shouldn't it just run in 32 bit compatibility
mode?" Unfortunately the answer to that is no. If you build your
application for "ANY CPU" then you can end
up with a 64 bit version of the code which doesn't work as
planned. To get around this issue, you can force
the compile to 32 bit mode. To do this in VS2005, bring up your
solution properties (right click the
solution header in your solution explorer and select Properties)
then navigate to the Build tab of the
properties. One of the options there is Target Platform. To
ensure a 32 bit build, change that from "ANY
CPU" to "x86". Rebuild your solution and give it a shot, you
should now have your printing back and some of those odd screen
issues may be resolved.
Back To The Top |
Compile|
CPU|
Platforms|
Machines|
Rebuild|
X86|
Navigate|
Solution Explorer| Solution Header| Compatibilty Mode|
Screen Draw| Routines| Environments|
Vista|
Visual Studio| Applications| |
keywords provided by
www.Extractor.com
|
| |
|
|
May 2007 |
|
| |
|
| Tech
Tip: Converting right mouse button click
to left mouse button click with dbiDayView. |
|
Convert
a right mouse button click into a left mouse button click in the
dbiDayView control. This causes the time area under the mouse to
become selected thereby allowing the developer to process the
right mouse click in terms of the time area on which the click
event occurred.
In the declarations for your form place the following code
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As
Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As
Long, ByVal dwExtraInfo As Long)
Const MOUSEEVENTF_LEFTDOWN = &H2
Const MOUSEEVENTF_LEFTUP = &H4
Const MOUSEEVENTF_MIDDLEDOWN = &H20
Const MOUSEEVENTF_MIDDLEUP = &H40
Const MOUSEEVENTF_MOVE = &H1
Const MOUSEEVENTF_ABSOLUTE = &H8000
Const MOUSEEVENTF_RIGHTDOWN = &H8
Const MOUSEEVENTF_RIGHTUP = &H10
This creates a reference to the mouse_event function in the
User32 library which allows the developer to synthesize mouse
events, in this case create a left mouse click.
In the mouse down event in the dbiDayView control place the
following code
If e.Button = MouseButtons.Right Then If the user clicks on the
right mouse button
mouse_event(MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0&, 0&,
0, 0)
Generate a Left Mouse Click event programmatically
End If
Back To The Top |
Developer|
Time Area| dbiDayView Control| Synthesize| Reference|
Declartions| |
keywords provided by
www.Extractor.com
|
| |
|
|
April 2007 |
|
| |
|
| Tech Tip
Solution::Schedule.NET Time bar styles |
|
Greetings and salutations, today we are going to take a quick
peek at the Timebar style and how we can use them to achieve
some unique looks including fade fills and stacked timebars.
Each timebar can be assigned a special style that controls how
it looks. The styles themselves can modify the default
appearance of timebars tremendously. For example we can apply
fade effects, set the height and offset so we can stack bars
on top of each other, and we can apply start/end images. While
we have the nuts and bolts of how to do this in our demo
applications, sometimes they look more intimidating than they
really are. For example lets say I want three unique time bar
styles, I can declare 3 global variables (modular or form level,
whichever appeals to your sense of programming)
Dim intBlueFadeStyle as integer
Dim intRedFadeStyle as integer
Dim intPeoplePicStyle as integer
Dim dbiTimeBarStyle as Dbi.WinControl.Schedule.dbiTimeBarStyle
Now we can set up our timebar styles
dbiTimeBarStyle = new Dbi.WinControl.Schedule.dbiTimeBarStyle
make a new style dbiTimeBarStyle.StartImage
= -7 dbiTimeBarStyle.EndImage = -7 dbiTimeBarStyle.BarHeight = 8
dbiTimeBarStyle.VerticalOffset = 10
dbiTimeBarStyle.BackColor = Color.Cyan
dbiTimeBarStyle.BackColorTo = Color.SteelBlue
dbiTimeBarStyle.FillType = Dbi3.enumFillType.Horizontal
intBlueFadeStyle = me.DbiSchedule1.TimeBarStyles.Add (dbiTimeBarStyle)
dbiTimeBarStyle = Dbi.WinControl.Schedule.dbiTimeBarStyle make
a new style dbiTimeBarStyle = New
Dbi.WinControl.Schedule.dbiTimeBarStyle
dbiTimeBarStyle.StartImage = -5
dbiTimeBarStyle.EndImage = -5
dbiTimeBarStyle.BarHeight = 8
dbiTimeBarStyle.VerticalOffset = -5
dbiTimeBarStyle.BackColor = Color.Red
dbiTimeBarStyle.BackColorTo = Color.White
intRedFadeStyle = me.DbiSchedule1.TimeBarStyles.Add (dbiTimeBarStyle)
dbiTimeBarStyle = New Dbi.WinControl.Schedule.dbiTimeBarStyle
make a new style dbiTimeBarStyle.StartImage
= 0 dbiTimeBarStyle.EndImage = 1 dbiTimeBarStyle.BarHeight = 6
intPeoplePicStyle = me.DbiSchedule1.TimeBarStyles.Add (dbiTimeBarStyle)
So we now have some nice styles to play with, we can apply them
to timebars just by setting the timebar
style property.
Dim newTimebar as new Dbi.Wincontrol.Schedule.dbiTimeBarItem
newTimebar.start = now
newTimebar.end = newtimebar.start.adddays(2) newTimebar.Style =
intBlueFadeStyle
me.dbiSchedule1.Items(0).Timebars.Add (newTimebar)
And there we go, we can do all kinds of things with the styles
this way, including my favorite stackable
bars. I wrote a quick routine to scan through each item s
timebars. If I found a conflict then I set the
first one to a style with a lower vertical offset, then the next
ones I can keep just iterating through. You
can be quite creative with your styles and really make things
pop with some good fills and images.
Back To The Top |
Time bar|
Bar|
Offset|
Iterating|
Lower Vertical
Offset|
Stackable Bars| Timebar Style| Property|
Modular|
Global Variable| Declare|
Unique Time Bar|
Demo Applications| Stacked Timebars| |
keywords provided by
www.Extractor.com
|
| |
|
|
March 2007 |
|
| |
|
| Tech
Tip - DBI ActiveX and .Net Controls in Vista |
|
Welcome,
come and sit around the projector, today we are going to talk
about our new best friend VISTA. Ok, enough of the sales pitch,
let's see how DBI controls work with VISTA.
To start with let's get the controls loaded onto a development
box. You are going to have to be logged in as administrator,
then you are going to want to right click the MSI/.exe
installation programs and select "Run as administrator". Why are
we going to do this you are bound to ask, aren't I logged in as
administrator? Yes you are, however, you still have to do the
right click so you are prompted when VISTA asks for elevated
privileges. This will happen both during the installation and
when you run the licensing programs. So if you are seeing Error
#5 or getting demo popups even though you ran the licensing
application, make sure to right click and run as administrator.
Now for some other goodies we've found along the way. RegSvr32
and our .OCX products. It used to work fine when I ran regsvr32
by double clicking an OCX and all was good with the world. Now
not so much. There are ways you can set the file properties and
run as permissions on the actual regsvr32.exe and generic .ocx
files, but in our experience that can get a bit flaky. Our best
success comes from (once again, our friend) right click on the
command prompt icon and select "Run as administrator". Then use
regsvr32 manually via the command prompt and viola, the ocx's
get registered in the right places. As always there are ways
around this, you can disable the User Account Control - UAC,
this isn't recommended however.
As far as functionality, so long as the controls are installed
and licensed we have seen no adverse VISTA effects, nor had any
support requests outside of the UAC/Installation issues. VISTA
and DBI controls...they just work.
Back To The Top |
Administration|
Vista|
OCX|
RegSvr32|
Licensing|
UAC|
Command Prompt|
Support Requests|
User Account Control| Command Prompt Icon|
Permissions|
File Properties|
OCX Products| Elevated Privileges| |
keywords provided by
www.Extractor.com
|
| |
|