473,395 Members | 2,796 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Control resize and positioning at run time. VB.Net

Can any one help me, regarding resizing and positioning a control at run time in VB.Net.
Nov 10 '08 #1
1 22561
joedeene
583 512MB
Can any one help me, regarding resizing and positioning a control at run time in VB.Net.
Well, to start off with, you can set the control's size by using the Control.Size Property. Also, you can set the position(or location I think you are referring to) by using the Control.Location Property.

Here's a sample code to increase a button's, the control's, size each time you click on the button.

Expand|Select|Wrap|Line Numbers
  1.         private void button1_Click(object sender, EventArgs e)
  2.         {
  3.             button1.Size = new Size(button1.Width + 5, button1.Height + 5);
  4.         }
  5.  
To change the location of the control, the following code may be useful: It changes the location by adding 5 pixels to both the button's X and Y coordinates.

Expand|Select|Wrap|Line Numbers
  1.         private void button1_Click(object sender, EventArgs e)
  2.         {
  3.             button1.Location = new Point(button1.Location.X + 5, button1.Location.Y + 5);
  4.         }
Those are just sample snippets to get you familiar with using those properties. I'd also like to point out that you've posted this in the wrong forum. So, I will ask an Admin to move it to the proper forum. Please read thoroughly through the Posting Guidelines as you are a new member.

Also, I just noticed you're in VB.NET, and I've given code in C#. If you cannot translate the code off hand then have a look at this site as it will help you in comparing the differences between the two languages and help you translate it.

joedeene
Nov 10 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: cefrancke | last post by:
I have a Tab control containing pages and many other controls. I would like to set the position of the tab control during Load or Open (btw, where is the place to do this?). During Design Time,...
1
by: Jink Welby | last post by:
Can anyone tell me how to create at ActiveX control ar run-time in code without using a form? I want to instantiate and use the control from within a non-visual class. Please help! Thanks in...
0
by: obj | last post by:
Dear all: My english is poor.forgive me. i use GDI+ class in my MFC program.I want to do resize the Bitmap.But I have a importance point of time of execution of Resize Bitmap. I use c# to...
2
by: Karl | last post by:
Can anyone tell me how to add a required field validator control at run-time? I have a form that the textbox controls are all added at run-time. This all works fine. When I add a validator...
0
by: Zorpiedoman | last post by:
Get your expert hat on.... I've created a UserControl which inherits ContainerControl. When I drop another control onto this control in design time view, I want to rename the new control and...
4
by: AB | last post by:
Hi All, I would like to add controls that stored in DB dynamically, and I don't know their names or their number. The names of the controls is important therefore I can't create cmbArr(0),...
0
by: Kasey | last post by:
In my application I don't want the operator to have access to the operating system. Can I call the control panel date/time from inside my application and have the operator change the date/time and...
1
by: --== Alain ==-- | last post by:
Hi, I still have problem updating my custom control at design time. When i change a property of my custom control in the property window, i would like to see this change immediately on my custom...
1
by: =?Utf-8?B?QnJldHQ=?= | last post by:
I have a basic user control that I want to localize. I created a global resource and connected up the properties I want to localize using an explicit localization expression. Everything works...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.