Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am developing an application in which there are two buttons say Button1 and Button2,Button2 appears only in some special condition,what i am trying to do is when Button2 appears Button1 should change its position,ie it should be shifted to side of the screen,any idea or help to achieve this will be greatly appreciated.Thanks.
Posted

1 solution

You can try using the setLayoutParams[^] method of the button[^].

Create an AbsoluteLayout[^] object with the dimension and coordinates you want.
Java
AbsoluteLayout.LayoutParams layout = new AbsoluteLayout.LayoutParams(width, height, xPosition, yPosition);
and use it to set the new position of the button
Java
Button1.setLayoutParams( layout );
 
Share this answer
 
Comments
azhar eqbal 20-Dec-12 1:56am    
@Andre,though i have not tried it yet but i appreciate your concern towards my problem,ThankYou So Much!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900