- Telekom TV SmartBox: szolgáltatói set-top box alacsony korlátokkal
- Milyen videókártyát?
- Hobby elektronika
- Pánik a memóriapiacon
- Kompakt vízhűtés
- Samsung LCD és LED TV-k
- NVIDIA GeForce RTX 3060 Ti / 3070 / 3070 Ti (GA104)
- Menekül a HEVC licencdíja elől a HP és a Dell
- Melyik tápegységet vegyem?
- AMD K6-III, és minden ami RETRO - Oldschool tuning
Új hozzászólás Aktív témák
-
trisztan94
őstag
Egy ténylegesen C# kérdés most:
XAML-ben a definiált GRID ahogyan észrevettem egyáltalán nem úgy működik, mint a Windows Forms-os.
3 sorban van összesen 12 gomb, random gomboknak szeretném a Content attribútumát változtatni, de sehogyan sem tudok rá hivatkozni..
<Grid x:Name="buttons_container" HorizontalAlignment="Center" VerticalAlignment="Bottom">
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition Height="70"/>
<RowDefinition Height="70"/>
</Grid.RowDefinitions>
<Grid x:Name="buttons_first_row" Grid.Row="0" Width="600">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
</Grid.ColumnDefinitions>
<Button HorizontalAlignment="Center" Grid.Column="0" Content="" Foreground="White" Height="auto" Width="150" />
<Button HorizontalAlignment="Center" Grid.Column="1" Content="" Foreground="White" Height="auto" Width="150" />
<Button HorizontalAlignment="Center" Grid.Column="2" Content="" Foreground="White" Height="auto" Width="150" />
<Button HorizontalAlignment="Center" Grid.Column="4" Content="" Foreground="White" Height="auto" Width="150" />
</Grid>
<Grid x:Name="buttons_second_row" Grid.Row="1" Width="600">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
</Grid.ColumnDefinitions>
<Button HorizontalAlignment="Center" Grid.Column="0" Content="" Foreground="White" Height="auto" Width="150" />
<Button HorizontalAlignment="Center" Grid.Column="1" Content="" Foreground="White" Height="auto" Width="150" />
<Button HorizontalAlignment="Center" Grid.Column="2" Content="" Foreground="White" Height="auto" Width="150" />
<Button HorizontalAlignment="Center" Grid.Column="4" Content="" Foreground="White" Height="auto" Width="150" />
</Grid>
<Grid x:Name="buttons_third_row" Grid.Row="2" Width="600">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
</Grid.ColumnDefinitions>
<Button HorizontalAlignment="Center" Grid.Column="0" Content="" Foreground="White" Height="auto" Width="150" />
<Button HorizontalAlignment="Center" Grid.Column="1" Content="" Foreground="White" Height="auto" Width="150" />
<Button HorizontalAlignment="Center" Grid.Column="2" Content="" Foreground="White" Height="auto" Width="150" />
<Button HorizontalAlignment="Center" Grid.Column="4" Content="" Foreground="White" Height="auto" Width="150" />
</Grid>
</Grid>InterfaceDesigner-en próálható.
Tehát az a lényeg, hogy két random számom van: x és y. Az x az oszlopokat, az y a sorokat jelöli.
Ha pl. a 3-mat dob ki, akkor a 3. sor x. elemét szeretném módosítani.
Próbáltam így C#-ban:
buttons_first_row.Children.ElementAt(2)...ez szépen meg is találja a nekem kellő button-t (jelen esetben az első sor 3.), de módosítani sehogy sem tudom, ugyanis nincs .Content tulajdonsága a System.Windows.UIElement-nek.
Hogyan tudnám ezt szépen megoldani? Adjak minden gombnak egyedi nevet, aztán egy baromi nagy switch elágazással jelöljem ki őket?
Új hozzászólás Aktív témák
● ha kódot szúrsz be, használd a PROGRAMKÓD formázási funkciót!
- iPhone topik
- Telekom TV SmartBox: szolgáltatói set-top box alacsony korlátokkal
- GoodSpeed: A RAM-válság és annak lehetséges hatásai
- Samsung Galaxy A54 - türelemjáték
- Ismét az Apple veheti át a piacvezető pozíciót
- Milyen videókártyát?
- Hobby elektronika
- PayPal
- Kerékpárosok, bringások ide!
- Okosóra és okoskiegészítő topik
- További aktív témák...
- Samsung Galaxy S22 Ultra 12/256GB Phantom Black, fóliás új állapot, Regalaxy
- Keressek intel i7-i9!!
- Szép! Lenovo Thinkpad T14s G2 Üzleti "Golyóálló" Laptop 14" -50% i7-1185G7 4Mag 16GB/1TB FHD IPS
- Szép! Lenovo Thinkpad T14s G2 Üzleti "Golyóálló" Laptop 14" -50% i7-1185G7 4Mag 16GB/512GB FHD IPS
- Dell PowerEdge T110 II PC, Xeon E3-1220 v2 CPU, 32 GB DDR3 RAM, 2 x 1 TB SAS HDD
- Xiaomi Redmi Note 13 256GB, Kártyafüggetlen, 1 Év Garanciával
- Lenovo E490 Notebook i7/16/500
- Honor 200 Lite / 8/256GB / Kártyafüggetlen / 12HÓ Garancia
- Újszerű Apple MacBook Air M1 13.3 - 8GB/256GB - Asztroszürke - 150 Ciklus - 92% akku - 1 év gari -
- GYÖNYÖRŰ iPhone 12 Pro Max 128GB Pacific Blue -1 ÉV GARANCIA -Kártyafüggetlen, MS3996, 100% Akkumulá
Állásajánlatok
Cég: BroadBit Hungary Kft.
Város: Budakeszi
Cég: Laptopműhely Bt.
Város: Budapest


