| | |
Can't resize with ResizeDraw
Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
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
Views: 1000 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast button buttons c# chat check checkbox class client code combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms ftp function gdi+ http httpwebrequest image index input install label list listbox listener login mandelbrot math mouseclick mysql networking operator oracle path photoshop picturebox pixelinversion prime programming radians regex remote remoting resource richtextbox save saving serialization server socket sql statistics stream string table tcp text textbox time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






