Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
1.12/5 (3 votes)
See more:
I want to create multiple textboxes on clicking particular button.
And then want to change font of textbox which i have clicked on selecting from font combobox.
Posted
Updated 11-Jul-14 1:29am
v2
Comments
SRS(The Coder) 11-Jul-14 7:30am    
are you talking about asp.net server controls ? Web or Windows application, can you please add section of your code here ?
[no name] 11-Jul-14 7:37am    
Change the font the exact same say as your normally would through code.
arvind mepani 11-Jul-14 7:59am    
Explain what you want exactly ,Provide code you have try to implement.

1 solution

thanks everybody for your valued comments...i have solved my problem by doing following.

VB
Private Sub btnBold_Click(sender As Object, e As EventArgs)
    If btnBold.BackColor = Color.White Then
        For Each c As Control In Me.pnlDesign.Controls
            If TypeOf c Is TextBox AndAlso c.Name.ToString = "txt" & tNo Then
                c.Font = New Font(cboFont.Text, Convert.ToSingle(cboSize.Text), FontStyle.bold)
            End If
        Next
        btnBold.BackColor = Color.Aqua
    Else
        For Each c As Control In Me.pnlDesign.Controls
            If TypeOf c Is TextBox AndAlso c.Name.ToString = "txt" & tNo Then
                c.Font = New Font(cboFont.Text, Convert.ToSingle(cboSize.Text), FontStyle.Regular)
            End If
        Next
        btnBold.BackColor = Color.White
    End If
End Sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900