Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Locked Controls in Visual Studio 2005

Posted on 2007-10-16
18
Medium Priority
?
289 Views
Last Modified: 2013-11-26
Hello,

I'm new to Visual Studio 2005, and I'm having trouble doing something very simple.

I've put two command buttons on the default.aspx form of my new project.  For whatever reason, I can't move them on the page.  They are locked in position.  I've looked for a "snap to grid" property or something to that effect, but have come up empty handed?

What's the secret?
0
Comment
Question by:NigelRocks
  • 9
  • 9
18 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 20096546
1) What type of controls?

2) If you right-click on the form, there is a 'Lock Controls' menu option that is checked or unchecked depending on what you need.

Bob
0
 
LVL 1

Author Comment

by:NigelRocks
ID: 20143274
So far I'm just trying to place 2 text boxes.

I don't see anything about locking or unlocking forms or controls.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 20143964
Are you saying that when you right-click on the form, that there isn't a Lock Controls menu option?

Bob
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 1

Author Comment

by:NigelRocks
ID: 20144368
Yep
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 20144552
1) What version of 2005 do you have?

2) Here is a screen shot from 2005 SP1 Team Edition:

https://filedb.experts-exchange.com/incoming/ee-stuff/5174-Lock-Controls.png 

Bob
0
 
LVL 1

Author Comment

by:NigelRocks
ID: 20171442
I have 2005 Professional, specifically version 8.0.50727.  I still don't see anything about locking controls.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 20171520
Right-click the form background to see this context menu:

https://filedb.experts-exchange.com/incoming/ee-stuff/5247-Lock-Controls.png 

Bob
0
 
LVL 1

Author Comment

by:NigelRocks
ID: 20171556
I guess I should've mentioned that this is a web form, not a windows form.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 20171630
It had to be something like that (d'oh--smackin' head).  How are the web controls defined?  Are they using absolute positioning, relative positioning or flow layout?

Bob
0
 
LVL 1

Author Comment

by:NigelRocks
ID: 20171883
How do I determine this?  I looked under "properties" and saw nothing for either control.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 20171942
Look in the HTML designer, and see if there is a style="position: absolute", or paste the control HTML here.

Bob
0
 
LVL 1

Author Comment

by:NigelRocks
ID: 20245827
This is the HTML for the page so far:


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Button ID="cmdNewVersion" runat="server" Text="New Version" />
        <asp:Button ID="cmdNewUser" runat="server" Text="New User" /></div>
    </form>
</body>
</html>
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 20246946
You can't move controls that are placed on a flow-layout page.

Bob
0
 
LVL 1

Author Comment

by:NigelRocks
ID: 20309714
As far as I can, this is just like any other .aspx page.  I'm not seeing properties for "flow layout".  Also, I have a textbox that I CAN move around on the page, but a label I can't.  Both of these controls were dragged and dropped in the same way.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 20312194
If you look at the control in the HTML designer, and it doesn't have style="position: absolute", then the page is using flow layout and you can't move the controls.

Bob
0
 
LVL 1

Author Comment

by:NigelRocks
ID: 20316694
Adding that attribute has freed up the controls, but I'm still confused about somethings.

You said that if a CONTROL doesn't have style-"posotion: absolute" then the PAGE is using flow control layout.  Shouldn't the page drive the controls instead of the other way around?  Am I going to have to do this to every control I add?

I don't remember being asked by the IDE if I want to use flow control layout.  What mistake did I make to cause this to happen in the first place?

0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 20320073
1) The default positioning for controls is flow layout

2) The positioning for controls with 2.0 is by control, and not defined at the page level, so you can mix flow layout and grid layout (position: absolute).

3) You can set the default positioning for all new controls added to the page from the Layout | Position | Auto-position Options menu.

Bob
0
 
LVL 1

Author Comment

by:NigelRocks
ID: 20332352
Because of your patience, I bumped the points up to 300 but I'm not sure it worked.  Did you get 300 instead of 125?
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses
Course of the Month14 days, 15 hours left to enroll

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question