11 Replies - 580 Views - Last Post: 23 April 2014 - 01:03 PM Rate Topic: -----

#1 BogdanCov  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 25-March 14

Make a button transparent C#

Posted 22 April 2014 - 11:18 AM

Hello. How can I make a button transparent? I know i can select color Transparent, but that takes the background color, and i want to be transparent all because i have a video behind it. What can i do? :o3
I have a video and there is some buttons which should be pressed. I could insert the buttons but they are semi-transparent...
Is This A Good Question/Topic? 0
  • +

Replies To: Make a button transparent C#

#2 astonecipher  Icon User is offline

  • Major DIC Head
  • member icon

Reputation: 564
  • View blog
  • Posts: 2,529
  • Joined: 03-December 12

Re: Make a button transparent C#

Posted 22 April 2014 - 11:25 AM

Change the opacity.

MSDN button opacity
Was This Post Helpful? 1
  • +
  • -

#3 BogdanCov  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 25-March 14

Re: Make a button transparent C#

Posted 22 April 2014 - 11:33 AM

View Postastonecipher, on 22 April 2014 - 11:25 AM, said:

Change the opacity.

MSDN button opacity


yes, but this work in WPF app, i need in Windows Form App..
Was This Post Helpful? 0
  • +
  • -

#4 astonecipher  Icon User is offline

  • Major DIC Head
  • member icon

Reputation: 564
  • View blog
  • Posts: 2,529
  • Joined: 03-December 12

Re: Make a button transparent C#

Posted 22 April 2014 - 11:38 AM

Have you tried to implement it?
Was This Post Helpful? 0
  • +
  • -

#5 Ryano121  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1362
  • View blog
  • Posts: 3,002
  • Joined: 30-January 11

Re: Make a button transparent C#

Posted 22 April 2014 - 11:39 AM

How to: Give Your Control a Transparent Background
Was This Post Helpful? 0
  • +
  • -

#6 BogdanCov  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 25-March 14

Re: Make a button transparent C#

Posted 22 April 2014 - 11:44 AM

i tried but it did not work, i don't know to implement in this case..

View PostRyano121, on 22 April 2014 - 11:39 AM, said:


so what should i do with this?
Was This Post Helpful? -1
  • +
  • -

#7 Ryano121  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1362
  • View blog
  • Posts: 3,002
  • Joined: 30-January 11

Re: Make a button transparent C#

Posted 22 April 2014 - 11:47 AM

Use the code in it. It gives you step by step instructions....
Was This Post Helpful? 0
  • +
  • -

#8 BogdanCov  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 25-March 14

Re: Make a button transparent C#

Posted 22 April 2014 - 11:54 AM

View PostRyano121, on 22 April 2014 - 11:47 AM, said:

Use the code in it. It gives you step by step instructions....


yes, that's work, the button is transparent but is no more functionaly.
Was This Post Helpful? 0
  • +
  • -

#9 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3469
  • View blog
  • Posts: 10,698
  • Joined: 05-May 12

Re: Make a button transparent C#

Posted 22 April 2014 - 08:16 PM

Show us your updated code. The information in that link should not have broken any existing functionality you used to have with the opaque version of the button.
Was This Post Helpful? 0
  • +
  • -

#10 BogdanCov  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 25-March 14

Re: Make a button transparent C#

Posted 23 April 2014 - 09:12 AM

there is the code
        private void Menu2_Load(object sender, EventArgs e)
        {
            vid.Owner = panel1;
            vid.Play();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //bla bla
            //code
        }


and this should be the updated code (i don't know what to with that)

        private void Menu2_Load(object sender, EventArgs e)
        {
            vid.Owner = panel1;
            vid.Play();
            SetStyle(ControlStyles.SupportsTransparentBackColor, true); //this should be there?
            this.BackColor = Color.Transparent;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //bla bla
            //code
        }

Was This Post Helpful? 0
  • +
  • -

#11 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3469
  • View blog
  • Posts: 10,698
  • Joined: 05-May 12

Re: Make a button transparent C#

Posted 23 April 2014 - 11:23 AM

Pretty obviously, you did not read that link. The first sentence (bold text mine):

Quote

By default, controls do not support transparent backcolors. However, you can allow your control to have a background color that is opaque, transparent, or partially transparent by using the SetStyle method in the constructor.

Was This Post Helpful? 0
  • +
  • -

#12 BogdanCov  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 25-March 14

Re: Make a button transparent C#

Posted 23 April 2014 - 01:03 PM

View PostSkydiver, on 23 April 2014 - 11:23 AM, said:

Pretty obviously, you did not read that link. The first sentence (bold text mine):

Quote

in the constructor


yee, now it all makes sense..
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1