Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27346

VS 2005 Get x/y coordinates of date on monthcalendar

$
0
0
Is there a way to get the x/y coordinates of a date on the monthcalendar control? I'm wanting to create a custom calendar that can X out dates, but I need the coordinates to paint of the date. Right now I'm using this:

visual basic.net Code:
  1. Protected Overloads Sub OnPaint(ByVal e As PaintEventArgs)
  2.         MyBase.OnPaint(e)
  3.  
  4.         'dateList is a list(of dates)
  5.         'xFontColor is a color that's set in the properties
  6.  
  7.         Dim g As Graphics = e.Graphics
  8.         Dim cross As String = "X"
  9.         Dim brushColor As New SolidBrush(xFontColor)
  10.  
  11.         For Each dates As Date In dateList
  12.             Me.SelectionStart = dates
  13.             g.DrawString(cross, xfont, brushcolor, x, y)
  14.         Next
  15.     End Sub

I'm thinking that if I could it would be getting it from the SelectionStart. That's why I have it in the loop. I'm up for any suggestions.

Viewing all articles
Browse latest Browse all 27346

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>