TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Peter Morris
NA
5
0
LayoutEngine.Layout - currentChildControl.Left is always zero?
May 13 2008 4:24 PM
Hi all
This is driving me mad! Can anyone tell me why the Left property of my
SelectImageItemControl is always zero when it should vary?
The relevant code is....
public override bool Layout(object container, LayoutEventArgs
layoutEventArgs)
{
base.Layout(container, layoutEventArgs);
Control parentControl = layoutEventArgs.AffectedControl;
int x = ControlSpacing.Width / 2;
int y = ControlSpacing.Height / 2;
foreach (Control currentChildControl in parentControl.Controls)
{
if (!currentChildControl.Visible)
continue;
currentChildControl.Location = new Point(x - currentChildControl.Width /
2, y - currentChildControl.Height / 2);
// *** Why is currentChildControl.Left 0 when x is a negative number?
x += ControlSpacing.Width;
if (x > parentControl.ClientRectangle.Right - ControlSpacing.Width / 2)
{
x = ControlSpacing.Width / 2;
y += ControlSpacing.Height;
}
}
return false;
}
I would appreciate any help, thankyou!
Pete
Reply
Answers (
0
)
Checked List Box
Tranparent Controls