PDA

نسخه کامل مشاهده نسخه کامل : اسنفاده از font برایvisualbasic 2005؟



scorpionblue2009
27-08-2008, 09:47
من یک برنامه نوشتم که یک text box داره من می خوام یک خط با فنت arial تایپ کنم و ادامه اون رو با فنت دیگه بنویسم.
اشکال:وقتی من فنت رو به متن text box کل متن به یک فنت در میاد و من می خوام از اون جا به بعد فقط فونت عوض بشه؟

rezanew
27-08-2008, 14:46
با textbox معمولي نمي تونين بايد از richtextbox استفاده كنين!

اينم يه نمونه كد:


' move cursor to the end and store the font there
RichTextBox1.SelectionStart = RichTextBox1.TextLength
Dim curFont As Font = RichTextBox1.SelectionFont

' now make the font at the end of the RTB Bold and add "Full name: "
RichTextBox1.SelectionFont = New Font(RichTextBox1.Font, FontStyle.Bold)
RichTextBox1.AppendText("Full name: ")

' change the font back to the original and add something else
RichTextBox1.SelectionFont = curFont
RichTextBox1.AppendText("Idle_Mind")