Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
how to get picture box image at right side in table lay out in c# at present i am getting image next line of label but i need picture box text beside a label in table lay out panel.Here is my code


PictureBox pb = new PictureBox();
pb.ImageLocation = ../imagesDT/answered.gif
tableLayoutPanel1.Controls.Add(pb);

I am trying to keep image beside the label in table lay out panel but at present getting image below the label
Posted

1 solution

One of the solutions is this: Use two panels in the same parent container control (Panel of Form); one panel with the property Dock set to DockStyle.Left, another — to DockStyle.Fill (or Right and Fill). This is better than TableLayoutPanel.

Please see:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.dock%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.dockstyle%28v=vs.110%29.aspx[^].

—SA
 
Share this answer
 

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