2 Replies - 330 Views - Last Post: 08 June 2020 - 12:46 PM Rate Topic: -----

#1 melprok   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 08-June 20

Cambiar el color de font de los botones al color inicialmente asignado

Posted 08 June 2020 - 11:05 AM

Saludos,

Yo estoy creando unos radio buttons de forma dinamica.

Entonces en el evento que yo le asigna a dicho control, necesito
que cuando yo oprima unos de los radio buttons cambiarle el color de fondo.

Y que los que anteriormente habia oprimido tengan el color por default que le asigne.

El problema es que al presionar un radio button, los demas no me cambiar al color original.

Gracias por la ayuda!


RadioButton rdo = sender as RadioButton;
 
 foreach (Control item in areasGroupBox.Controls)
   {
     rdo.BackColor = SystemColors.GradientActiveCaption;
 
    }
 rdo.BackColor = Color.FromArgb(192, 255, 192);





-----------
Mod: - google translated text.


Quote

Change the font color of the buttons to the initially assigned color


Cheers,

I am creating radio buttons dynamically.

So in the event that I assign to that control, I need
that when I press one of the radio buttons change the background color.

And that those who had previously oppressed have the default color assigned.

The problem is that when pressing a radio button, the others will not change me to the original color.

Thanks for the help!

This post has been edited by modi123_1: 08 June 2020 - 11:20 AM
Reason for edit:: adding translated text


Is This A Good Question/Topic? 0
  • +

Replies To: Cambiar el color de font de los botones al color inicialmente asignado

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15783
  • View blog
  • Posts: 63,262
  • Joined: 12-June 08

Re: Cambiar el color de font de los botones al color inicialmente asignado

Posted 08 June 2020 - 11:22 AM

Just a note this is an english primary forum.

I'll drop in the translated text to the post.
------------

Is this for a desktop app, WPF, ASP.NET, or something else?

Is the issue of an event not being hooked up to the newly created radio button? I am not seeing that code.

Where's the code where you are attempting to turn the other radiobuttons background color to something else?

You may need to loop through the 'control' collection.
Was This Post Helpful? 0
  • +
  • -

#3 DarenR   User is offline

  • D.I.C Lover

Reputation: 706
  • View blog
  • Posts: 4,566
  • Joined: 12-January 10

Re: Cambiar el color de font de los botones al color inicialmente asignado

Posted 08 June 2020 - 12:46 PM

im not seeing where you are telling it to change the other buttons
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1