Hirdetés
- droidic: Windows 11 önállóság nélküli világ: a kontroll új korszaka
- GoodSpeed: Pillangóhatás: F billentyű meghibásodása -új gamer számítógépasztal
- eBay-es kütyük kis pénzért
- Brogyi: CTEK akkumulátor töltő és másolatai
- sziku69: Fűzzük össze a szavakat :)
- sziku69: Szólánc.
- ubyegon2: Airfryer XL XXL forrólevegős sütő gyakorlati tanácsok, ötletek, receptek
- Ndruu: Segíts kereshetővé tenni a PH-s arcképeket!
- f(x)=exp(x): A laposföld elmebaj: Vissza a jövőbe!
- Luck Dragon: Asszociációs játék. :)
Ú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!
- One otthoni szolgáltatások (TV, internet, telefon)
- Mikrotik routerek
- Épített vízhűtés (nem kompakt) topic
- HiFi műszaki szemmel - sztereó hangrendszerek
- Folyószámla, bankszámla, bankváltás, külföldi kártyahasználat
- iPhone topik
- Lexus, Toyota topik
- PlayStation 5
- Projektor topic
- Fujifilm X
- További aktív témák...
- Keresek Zebra TC20 TC21 vagy valamilyen hasonló kaliberű 1D és 2D vonalkódok olvasására alkalmas pda
- LG 25GR75FG - E-Sport Monitor - FHD 360Hz 1ms - NVIDIA Reflex + G-sync - AMD FreeSync - HDR 400
- DELL Precision 7540 - Intel Core i9-9980HK, RTX 3000, 32GB, 1TB SSD (ELKELT)
- Ultimate előfizetés akár 4166 Ft/hó áron! Azonnali, automatizált aktiválással, csak Nálam!
- HIBÁTLAN iPhone 14 128GB Starlight -1 ÉV GARANCIA - Kártyafüggetlen, MS3238
Állásajánlatok
Cég: Promenade Publishing House Kft.
Város: Budapest
Cég: NetGo.hu Kft.
Város: Gödöllő

