Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace PrimerProyectoCSharp
- {
- /// <summary>
- /// Lógica de interacción para MainWindow.xaml
- /// </summary>
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- Grid miGrid = new Grid();
- this.Content = miGrid;
- Button miBoton = new Button();
- miGrid.Children.Add(miBoton);
- miBoton.Height = 90;
- miBoton.Width = 150;
- setContentButton(miBoton);
- }
- private void setContentButton(Button miBoton)
- {
- WrapPanel wp = new WrapPanel();
- wp.Children.Add(new TextBlock()
- {
- Text = "rojo",
- Foreground = new SolidColorBrush(Colors.Red),
- });
- wp.Children.Add(new TextBlock()
- {
- Text = "Azul",
- Foreground = new SolidColorBrush(Colors.Blue),
- });
- wp.Children.Add(new TextBlock()
- {
- Text = "Verde",
- Foreground = new SolidColorBrush(Colors.Green),
- });
- miBoton.Content = wp;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement