georgepatotk Posted March 22, 2005 Posted March 22, 2005 Usually we use System.Windows.Forms.HorizontalAlignment for TextBox alignment, and System.Drawing.ContentAlignment for Label alignment. I am wondering how to make use of System.Drawing.ContentAlignment in TextBox. Cause now I am faking the TextBox and make it looks like a Label. One of the property of the Label (.TextAlign) is a must in my situation. So, if you know, please helps.... 100,000X thanks in advance.. hehe.... :D Quote George C.K. Low
Leaders snarfblam Posted March 22, 2005 Leaders Posted March 22, 2005 The .TextAlign property is of type System.Windows.Forms.HorizontalAlignment. You can not use System.Drawing.ContentAlignment members for a text box. Textboxes do not support any type of vertical alignment except the default. Have you tried making a UserControl that draws the text? Labels and textboxes are meant for different uses and do not have much functionability in common beyond the fact that they both contain text. You want to show unicode chars, but a label can't do this, right? You want to vertically center the text and add background images, but a textbox can't do this. I don't know if the Graphics.DrawString() method will draw the chinese characters you need, but I'm guessing that more likely than not it will. Try it, and if it works, make a user control. Quote [sIGPIC]e[/sIGPIC]
*Experts* DiverDan Posted March 22, 2005 *Experts* Posted March 22, 2005 marble_eater, the textbox control does not have a paint properity and thus can not support Graphics.DrawString. George, I will need to add that functionality into the ImageTextBox control I made for you. Please send me a PM with your contact email address. Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
georgepatotk Posted March 23, 2005 Author Posted March 23, 2005 marble_eater, I had tried the drawstring in Label. It doesn't seem to work. DiverDan, I had sent my details to you. Thanks a lot for your kindly helps. I appreciate it a lot. Quote George C.K. Low
Leaders snarfblam Posted March 23, 2005 Leaders Posted March 23, 2005 I was not recommending using DrawString in a textbox. Quote [sIGPIC]e[/sIGPIC]
georgepatotk Posted March 23, 2005 Author Posted March 23, 2005 I had tried DrawString in TextBox, it works. But not for unicode. Anyway, thanks for your help, marble_eater. Your nick is cute, wondering whether you had ever eaten any marble.. Quote George C.K. Low
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.