如何将表格右侧的图片框放在窗口中c# [英] How to keep picture box right side of table lay out in window form c#

查看:111
本文介绍了如何将表格右侧的图片框放在窗口中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 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


这篇关于如何将表格右侧的图片框放在窗口中c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆