I just read your post, and I have a little idea that poped into my head right now.
You can make a virtual text box. I'll explain:
You take a PictureBox which in it you can draw anything you want.
You put a label in the PictureBox. You use the Form_KeyDown to write into the virtual text box, I mean, adding text to the label.
I Didn't tried it yet, because it just came up to me..
I'll try it, and later I'll post the project.
I didnt get your code that made the gradient, so i looked up the GradientFillRect API in API-Guide, and applied and and it works a lot faster. Here's the example they gave:
VB Code:
Private Type TRIVERTEX
x As Long
y As Long
Red As Integer 'Ushort value
Green As Integer 'Ushort value
Blue As Integer 'ushort value
Alpha As Integer 'ushort
End Type
Private Type GRADIENT_RECT
UpperLeft As Long 'In reality this is a UNSIGNED Long
LowerRight As Long 'In reality this is a UNSIGNED Long
End Type
Const GRADIENT_FILL_RECT_H As Long = &H0 'In this mode, two endpoints describe a rectangle. The rectangle is
'defined to have a constant color (specified by the TRIVERTEX structure) for the left and right edges. GDI interpolates
'the color from the top to bottom edge and fills the interior.
Const GRADIENT_FILL_RECT_V As Long = &H1 'In this mode, two endpoints describe a rectangle. The rectangle
' is defined to have a constant color (specified by the TRIVERTEX structure) for the top and bottom edges. GDI interpolates
' the color from the top to bottom edge and fills the interior.
Const GRADIENT_FILL_TRIANGLE As Long = &H2 'In this mode, an array of TRIVERTEX structures is passed to GDI
'along with a list of array indexes that describe separate triangles. GDI performs linear interpolation between triangle vertices
'and fills the interior. Drawing is done directly in 24- and 32-bpp modes. Dithering is performed in 16-, 8.4-, and 1-bpp mode.
Const GRADIENT_FILL_OP_FLAG As Long = &HFF
Private Declare Function GradientFillRect Lib "msimg32" Alias "GradientFill" (ByVal hdc As Long, pVertex As TRIVERTEX, ByVal dwNumVertex As Long, pMesh As GRADIENT_RECT, ByVal dwNumMesh As Long, ByVal dwMode As Long) As Long
Private Function LongToUShort(Unsigned As Long) As Integer
'A small function to convert from long to unsigned short
I have made a program all you can do is paste your text onto the virtual text box. When the program loads it will automatically put the clipboard text onto the label after that clicking ctrl+c will paste your text onto the label.