Adding another badge to Sales Form  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Adding another badge to Sales Form

Postby SBarnes » Tue Apr 08, 2025 2:11 pm

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;
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Adding another badge to Sales Form

Postby Mike.Sheen » Tue Apr 08, 2025 2:42 pm

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.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Adding another badge to Sales Form

Postby SBarnes » Tue Apr 08, 2025 3:46 pm

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);
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Adding another badge to Sales Form  Topic is solved

Postby SBarnes » Tue Apr 08, 2025 4:37 pm

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;   
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 2 guests