kriswinner
Member
- Joined
- Apr 23, 2009
- Messages
- 23
- Programming Experience
- 10+
I'm having an issue with the size of the drag and drop 'text cursor' on my application.
The code is very similar to this reference
Microsoft Visual C#: Listboxes - drag drop & reorder ,Microsoft Visual C#. - msdn.itags.org
Looking at the drawcursor sub,
within g.DrawString the text and fnt appear to be correct, but there seems to be a limit on how wide the cursor can be. Whatever that pixel limit is, it chops the cursor down to that size if I exceed it. As long as I keep my text down to 7 characters or so, the width restriction isn't an issue.
Is there a limit set somewhere that I'm not accounting for?
Thanks.
-KW
The code is very similar to this reference
Microsoft Visual C#: Listboxes - drag drop & reorder ,Microsoft Visual C#. - msdn.itags.org
Looking at the drawcursor sub,
VB.NET:
Sub drawcursor(ByVal text As String, ByVal fnt As Font)
Dim bmp As New Bitmap(1, 1)
Dim g As Graphics = Graphics.FromImage(bmp)
Dim sz As SizeF = g.MeasureString(text, fnt)
bmp = New Bitmap(CInt(sz.Width), CInt(sz.Height))
g = Graphics.FromImage(bmp)
g.Clear(Color.White)
g.DrawString(text, fnt, Brushes.Black, 0, 0)
g.Dispose()
textcursor = New Cursor(bmp.GetHicon)
bmp.Dispose()
End Sub
within g.DrawString the text and fnt appear to be correct, but there seems to be a limit on how wide the cursor can be. Whatever that pixel limit is, it chops the cursor down to that size if I exceed it. As long as I keep my text down to 7 characters or so, the width restriction isn't an issue.
Is there a limit set somewhere that I'm not accounting for?
Thanks.
-KW