[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Align the buttons to the same position

Posted on 2014-01-17
12
Medium Priority
?
249 Views
Last Modified: 2014-02-06
Hi,
I want to align both buttons to be on the same position. how?
t643.png
0
Comment
Question by:HuaMinChen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
12 Comments
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 39787859
Set the left position to the same value.
btn2.Left = btn1.Left;
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 39787863
In code-behind, I cannot choose this

btn1.Left

Open in new window

0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 39787890
Before
And the code  in C# of the click on button1
        private void button1_Click(object sender, EventArgs e)
        {
            button2.Left = button1.Left;
        }

After
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 45

Expert Comment

by:AndyAinscow
ID: 39787896
ps.  You need to replace btn1 and btn2 (button1 and button2) with the real names of the buttons in your code.
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 39787904
Sorry, in VS 2013, I get these
Error      3      'System.Web.UI.WebControls.Button' does not contain a definition for 'Left' and no extension method 'Left' accepting a first argument of type 'System.Web.UI.WebControls.Button' could be found (are you missing a using directive or an assembly reference?)      C:\App12\App12\Default.aspx.cs      443      23      App12
Error      4      'System.Web.UI.WebControls.Button' does not contain a definition for 'Left' and no extension method 'Left' accepting a first argument of type 'System.Web.UI.WebControls.Button' could be found (are you missing a using directive or an assembly reference?)      C:\App12\App12\Default.aspx.cs      443      43      App12

due to this line

bt_ite.Left = bt_obj.Left;

Open in new window

0
 
LVL 45

Accepted Solution

by:
AndyAinscow earned 435 total points
ID: 39787922
>>WebControls.Button

(Aha, you hadn't specified that sort of button.  With a button on a form the Left and Top properties do exist.)

I don't think you can change the position, only the width and height.  (Or have it in a table cell - there you can cheat because it is inside the cell which will be vertically aligned with the cell above).
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 39790395
I've requested that this question be deleted for the following reason:

The program does need the help regarding ASP page but the answers are just related to C# forms.
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 39790396
As pointed out in my previous comment, it does not seem to be possible with a web button.  No, you can't do that is a valid answer to a question.  (In the help files there are only width and height properties).
Also suggested is a method that would align buttons should it be suitable.
0
 
LVL 11

Author Comment

by:HuaMinChen
ID: 39790672
Andy,
The way you were talking about, is only applicable to C# form, but it is not for ASP page at all. This is the point!
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 39790797
>>The way you were talking about, is only applicable to C# form, but it is not for ASP page at all.
What I see here is the question area of .net programming with extra topics areas of .NET, C# Programming Language, Components - nothing about ASP or web.

When you later point out it is a WebButton (in the error message) then it is clear why my first suggestion isn't applicable.  That is why I made a further comment about it apparently not being possible to do what you asked for.  (Which is a valid answer, some questions can not be answered by yes as much as one would want them to be).

I'll abide by what a moderator decides.
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

650 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