1
I did a Trackbar to change the font size in Visualstudio Express 2015,but when I try to change the font it returns the error "Property or indexer 'Font.Size' cannot be Assigned to -- it is read only" and I have no idea what to do. Code:
private void FontTrackBar_Scroll(object sender, EventArgs e)
{
lblFontSize.Text = FontTrackBar.Value.ToString(); //seta o valor da barra numa label
int FontSizeInt = FontTrackBar.Value; //Variavel com o valor da trackbar
Form1.DefaultFont.Size = FontTrackBar.Value; //Aqui eu tento setar o tamanho da fonte e dá erro
}
private void Form1_Load(object sender, EventArgs e)
{
FontTrackBar.Value = Convert.ToInt16(8); //seta o padrão da fonte
lblFontSize.Text = FontTrackBar.Value.ToString();
}