Hi
Is it possible to resize, repositioning controls like (TextBox, Label, ....) during runtime on window Forms in (DotNet). How to proceed with this.
Thanks
Sriram
Hi
Is it possible to resize, repositioning controls like (TextBox, Label, ....) during runtime on window Forms in (DotNet). How to proceed with this.
Thanks
Sriram
Resizing and Repositioning Control on a Windows Form at runtime(.Net)
Deadly Trev
Thankyou.. Now iam able to move the textbox to another location at runtime, but is it possible to resize it during runtime
thanks in advance
Andy D
You need to use a Forms designer for your problem.
http://msdn.microsoft.com/msdnmag/issues/06/03/DesignerHosting/
matthewfoster
private
void textBox1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e){
if(e.Button == MouseButtons.Left){
//Get current X and Y int x = e.X; int y =e.Y; //get deltax and deltaytextBox1.Left += (x-deltaX);
textBox1.Top += (y-deltaY);
}
}
private void textBox1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e){
deltaX = e.X;
deltaY = e.Y;
}
plopez
Do you want to do it something like the VS.net designer
If not,you can set the Location property and Size property at any point of time.
Azeem Khan
You can-
private
void textBox1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e){
if(e.Button == MouseButtons.Left){
//Get current X and Y int x = e.X; int y =e.Y; //get deltax and deltaytextBox1.Left += (x-deltaX);
textBox1.Top += (y-deltaY);
textBox1.Height += y-deltaY;
textBox1.Width += x-deltaX;
}
}
This is some skeleton code,which I hope will get you going!!
ploplo
Hana