Hello everybody.

I've a question.
I tried to change font size of textBox named "textBox1"

Here is the function of the NumericUpDown:

private: System::Void numericUpDown2_ValueChanged(System::Object^  sender, System::EventArgs^  e) 
		 {
			 String^ Num2 = this->numericUpDown2->Text;
			 this->textBox1->Font->Size = Num2;
		 };

Errors that occur:

error C2039: 'set' : is not a member of 'System::Drawing::Font::Size'
error C2039: 'set' : is not a member of 'System::Drawing::Font::Size'

Recommended Answers

All 3 Replies

Size is read-only meaning you can't change its value.

Num2 is a String, is Font->Size an int or double?

Google for "System::Drawing::Font::Size" and you will find out what it is. Size returns a float. You can not use it to set the font size.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.