View | Details | Raw Unified | Return to bug 2090
Collapse All | Expand All

(-)a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MessageBox.cs (-4 / +7 lines)
Lines 219-228 namespace System.Windows.Forms Link Here
219
219
220
				// First we have to know the size of text + image
220
				// First we have to know the size of text + image
221
				Drawing.SizeF tsize = TextRenderer.MeasureString (msgbox_text, this.Font, max_width);
221
				Drawing.SizeF tsize = TextRenderer.MeasureString (msgbox_text, this.Font, max_width);
222
				text_rect.Size = tsize;
222
				text_rect.Height = tsize.Height;
223
				
223
224
				int iconImageWidth = 0;
224
				if (icon_image != null) {
225
				if (icon_image != null) {
225
					tsize.Width += icon_image.Width + 10;
226
					iconImageWidth = icon_image.Width + 10;
227
					tsize.Width += iconImageWidth;
226
					if(icon_image.Height > tsize.Height) {
228
					if(icon_image.Height > tsize.Height) {
227
						// Place text middle-right
229
						// Place text middle-right
228
						text_rect.Location = new Point (icon_image.Width + space_image_text + space_border, (int)((icon_image.Height/2)-(tsize.Height/2)) + space_border);
230
						text_rect.Location = new Point (icon_image.Width + space_image_text + space_border, (int)((icon_image.Height/2)-(tsize.Height/2)) + space_border);
Lines 287-292 namespace System.Windows.Forms Link Here
287
				else
289
				else
288
					this.ClientSize = new Size (tb_width + (space_border * 2), Height = new_size.Height + (space_border * 4));
290
					this.ClientSize = new Size (tb_width + (space_border * 2), Height = new_size.Height + (space_border * 4));
289
291
292
				text_rect.Width = new_size.Width - iconImageWidth;
293
290
				// Now we set the left of the buttons
294
				// Now we set the left of the buttons
291
				button_left = (this.ClientSize.Width / 2) - (tb_width / 2) + 5;
295
				button_left = (this.ClientSize.Width / 2) - (tb_width / 2) + 5;
292
				AddButtons ();
296
				AddButtons ();
293
- 

Return to bug 2090