我动态地绘制了标签但是我需要在每个标签之间填充红色的圆圈,没有空格。 [英] I have drawn the label dynamically But I need circle filled with red color between each label with no space.

查看:64
本文介绍了我动态地绘制了标签但是我需要在每个标签之间填充红色的圆圈,没有空格。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.VisualBasic.PowerPacks;

namespace WindowsFormsApplication3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
         
            for (int i = 0; i < 10; i++)
            {
                Label box = new Label();
                box.Tag = i.ToString();
                //box.Text = "a";
                box.BorderStyle = BorderStyle.Fixed3D;
                box.AutoSize = false;
                box.Height = 16;
                box.BackColor = Color.Red;
                //box.Location = new Point(10, i * 50); //vertical
                box.Location = new Point(i * 75, 1); //horizontal
                this.Controls.Add(box);
            }



        }



    }
}

我得到的当前输出如下所示 

Current Output I'm getting is like this below 

但是我需要标签之间的圆圈和类似下面的输出

But I need circles in between labels and something output like this as below

推荐答案

你好,

我认为最简单的方法是在每个标签的右侧插入一个图像:

i think that the easiest way to do this is by inserting an image at right of each label like this:

            this.label1.Image = Application.StartupPath + "\\ your image here ";
            this.label1.ImageAlign = ContentAlignment.MiddleRight;


希望它有帮助<

hope it helps

这篇关于我动态地绘制了标签但是我需要在每个标签之间填充红色的圆圈,没有空格。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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