| | |
Can't resize with ResizeDraw
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2006
Posts: 131
Reputation:
Solved Threads: 0
Hi,
In on of the lecture notes that was given to me by my prof, I was told that setting the ResizeRedraw value to true would allow whatever I drew on the form to be, well, resized. However, it does not seem to work. Here is my code:
In on of the lecture notes that was given to me by my prof, I was told that setting the ResizeRedraw value to true would allow whatever I drew on the form to be, well, resized. However, it does not seem to work. Here is my code:
C# Syntax (Toggle Plain Text)
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Test1 { public partial class Form1 : Form { private Rectangle m_Rect; public Form1() { Point p = new Point(ClientRectangle.Width / 2 - 100 / 2, ClientRectangle.Height / 2 - 100 / 2); Size s = new Size(100, 100); m_Rect = new Rectangle(p, s); InitializeComponent(); ResizeRedraw = true; } private void Form1_Paint(object sender, PaintEventArgs e) { Brush b = new SolidBrush(Color.Red); Pen pen = new Pen(new SolidBrush(Color.Black)); e.Graphics.DrawRectangle(pen, m_Rect); e.Graphics.FillRectangle(b, m_Rect); } } }
•
•
Join Date: Mar 2006
Posts: 131
Reputation:
Solved Threads: 0
•
•
•
•
its not clear whats not working, it most likely is working as the code you showed looked to be compilable, and the redraw would tell the component to redraw if it were resized..
![]() |
Other Threads in the C# Forum
- Previous Thread: Dynamic Loop + Array
- Next Thread: Business object in web application
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# chat check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms function gdi+ httpwebrequest image index input install java label list listbox listener mandelbrot math mouseclick mysql nargalax networking object operator path photoshop picturebox pixelinversion polynomial post prime programming radians regex remote remoting richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






