Currently i want to make some enhancement to my user control.
in this enhancement i try to create a property where it can accept multiline string input value. you know...just like multiline property in textbox control, or list property in combo box.
any answer woulb be appreciate
If I understood well you can look for the DrawText API.
Here's an MSDN Example
(I modified it in italian anyway is not important)
Code:
Private Sub Command1_Click()
Dim lSuccess As Long
Dim sPrintText As String
Dim MyRect As RECT
Form1.Font.Size = 12
Form1.ScaleMode = vbPixels
MyRect.Left = 0
MyRect.Right = Form1.ScaleWidth
MyRect.Top = 40
MyRect.bottom = Form1.ScaleHeight
sPrintText = "Proviamo a vedere in che modo allinea questa stringa, dovrebbe allinearla in qualche modo giusto no?" + vbcrlf + "tipo ciai presente cappuccetto rosso e il lupo cattivo?"
lSuccess = DrawText( _
Form1.hDC, sPrintText, Len(sPrintText), MyRect, _
DT_LEFT Or DT_EXPANDTABS Or DT_NOCLIP Or DT_NOPREFIX Or DT_WORDBREAK Or DT_EXTERNALLEADING _
)
End Sub
++++++++[>++++++++<-]>+.<+++[>++++<-]>+.<++[>-----<-]>.<+++[>++++<-]>++.<+++[>----<-]>-.----. God does not play dice with the universe.(A.Einstein)
My problem is how to tell vb how to react to my property type.
For example...if we define a property like font type, the property window will automatically show the font dialog when we try to manage the font property on property window, or if we define a property as stdpicture, vb will show picture dialog when we try to manage the property, if we define simply as a string, then vb will treat it just like text property in textbox control, but when we set the multiline property = TRUE, then vb will alter the treatment of the text property. am i clearly describe my problem ?
Before i post the question, i've already search on google, try to find a user control with such property i want but i couldn't find one. i have also tried to use user control wizard and use all the property from the wizard, but still there is no such property i need.
You must manage property value changes inside the Property Let of your Multiline...
Code:
Private m_Multiline As Boolean
[...]
Public Property Let Multiline(ByVal vNewValue As Boolean)
m_Multiline = vNewValue
PropertyChanged "Multiline"
' Now call redrawing routine managing the m_Multiline member
End Property
++++++++[>++++++++<-]>+.<+++[>++++<-]>+.<++[>-----<-]>.<+++[>++++<-]>++.<+++[>----<-]>-.----. God does not play dice with the universe.(A.Einstein)
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.