Page 1 of 1

Adding another badge to Sales Form

PostPosted: Tue Apr 08, 2025 2:11 pm
by SBarnes
I am trying to add a Jiwa badge to the sales form, which the code below will do but with one problem the bage is appearing in a rectangle with a black background, how can I resolve this?

I Have tried image trnapsarent color but that doesn't work.


Code: Select all
            Infragistics.Win.Appearance appearance = new Infragistics.Win.Appearance();
            appearance.BackColor = Color.Red;
            appearance.ForeColor = Color.White;
            appearance.TextHAlignAsString = "Center";
            appearance.TextVAlignAsString = "Middle";

            JiwaBadge lbldStatus = new JiwaBadge();
           
            lbldStatus.Appearance = appearance; 


            lbldStatus.ArcWidth = 20;
            lbldStatus.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);

            lbldStatus.Name = "lbldStatus";
            lbldStatus.Size = new Size(62, 17);
            lbldStatus.Text = "Status";
            this.sForm.TableLayoutPanel1.Controls.Add(lbldStatus, 3, 6);
            lbldStatus.Visible = true;
          //  lbldStatus.ImageTransparentColor = Color.Transparent;

Re: Adding another badge to Sales Form

PostPosted: Tue Apr 08, 2025 2:42 pm
by Mike.Sheen
SBarnes wrote:I am trying to add a Jiwa badge to the sales form, which the code below will do but with one problem the bage is appearing in a rectangle with a black background, how can I resolve this?


You need to add an UltraPanel control, and add the badge to ClientArea.Controls of the panel.

Re: Adding another badge to Sales Form

PostPosted: Tue Apr 08, 2025 3:46 pm
by SBarnes
I tried that with the code below but unfortunately the problem still exists


Code: Select all
            Infragistics.Win.Appearance appearance = new Infragistics.Win.Appearance();
            appearance.BackColor = Color.Red;
            appearance.ForeColor = Color.White;
            appearance.TextHAlignAsString = "Center";
            appearance.TextVAlignAsString = "Middle";


            JiwaBadge lbldStatus = new JiwaBadge();

            lbldStatus.Appearance = appearance;
           

            lbldStatus.ArcWidth = 20;
            lbldStatus.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);

            lbldStatus.Name = "lbldStatus";
            lbldStatus.Size = new Size(60, 17);
            lbldStatus.Text = "STATUS";
            Infragistics.Win.Misc.UltraPanel panelBadge = new Infragistics.Win.Misc.UltraPanel() { Name = "panelBadge" };
            panelBadge.Dock = DockStyle.Fill;
           
            lbldStatus.Visible = true;
            panelBadge.ClientArea.Controls.Add(lbldStatus);

            this.sForm.TableLayoutPanel1.Controls.Add(panelBadge, 3, 6);

Re: Adding another badge to Sales Form  Topic is solved

PostPosted: Tue Apr 08, 2025 4:37 pm
by SBarnes
Finally got it to work, the trick is as well as putting the badges on a panel you need to set the panel to transparent for the background colour.

Thanks for the help, Mike.


Code: Select all
  Infragistics.Win.Appearance appearance = new Infragistics.Win.Appearance();
  appearance.BackColor = Color.Red;
  appearance.ForeColor = Color.White;
  appearance.TextHAlignAsString = "Center";
  appearance.TextVAlignAsString = "Middle";

  Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance();
  appearance2.BackColor = Color.Blue;
  appearance2.ForeColor = Color.White;
  appearance2.TextHAlignAsString = "Center";
  appearance2.TextVAlignAsString = "Middle";


  JiwaBadge lbldStatus = new JiwaBadge();

  lbldStatus.Appearance = appearance;

  JiwaBadge lbldETA = new JiwaBadge();

  lbldETA.Appearance = appearance2;


  lbldStatus.ArcWidth = 20;
  lbldStatus.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);

  lbldStatus.Name = "lbldStatus";
  lbldStatus.Size = new Size(60, 17);
  lbldStatus.Text = "Status";


  lbldETA.ArcWidth = 20;
  lbldETA.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);

  lbldETA.Name = "lbldETA";
  lbldETA.Size = new Size(60, 17);
  lbldETA.Location = new Point(70, 0);
  lbldETA.Text = "ETA";

  Infragistics.Win.Misc.UltraPanel panelBadge = new Infragistics.Win.Misc.UltraPanel() { Name = "panelBadge" };
  panelBadge.Dock = DockStyle.Fill;
  panelBadge.Appearance.BackColor = Color.Transparent;