如何将表格右侧的图片框放在窗口中c# [英] How to keep picture box right side of table lay out in window form c#
问题描述
目前在c#中如何获取图片右侧的图片框图像我正在获取图片下一行标签,但我需要在桌面布局面板旁边的图片框文字。这是我的代码
PictureBox pb = new PictureBox();
pb.ImageLocation = ../ imagesDT / answers.gif
tableLayoutPanel1.Controls.Add(pb);
我试图将图像保留在表布局面板的标签旁边,但目前正在标签下方的图像
其中一个解决方案是:在同一个父容器控件中使用两个面板(面板
表格
);一个面板的属性Dock
设置为DockStyle.Left
,另一个 - 到DockStyle.Fill
(或正确和填写)。这比TableLayoutPanel
更好。
请参阅:
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
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
One of the solutions is this: Use two panels in the same parent container control (Panel
ofForm
); one panel with the propertyDock
set toDockStyle.Left
, another — toDockStyle.Fill
(or Right and Fill). This is better thanTableLayoutPanel
.
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
这篇关于如何将表格右侧的图片框放在窗口中c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!