| | |
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 algorithm angle array barchart bitmap box broadcast buttons c# capturing check checkbox client combobox control conversion convert csharp custom database datagrid datagridview dataset datetime dbconnection degrees delegate development disappear draganddrop drawing encryption enum event excel file firefox form format forms function gdi+ httpwebrequest image index input install java label leak libraries list listbox mandelbrot math monodevelop mouseclick msword mysql operator path pause photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox round server sleep socket sql statistics stream string table tcpclientchannel text textbox thread time timer update usercontrol validation virtualization visualbasic visualstudio webbrowser windows winforms wpf xml






