<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[C# und .NET]]></title><description><![CDATA[Fragen zur Sprache C#, zu den Funktionen und Abläufen, Anwendungen und Befehlen. Außerdem der Anlaufpunkt zu Fragen rund um die **.net-Plattform**. Fragen zu den IDEs gehören nicht hier rein.]]></description><link>https://www.c-plusplus.net/forum/category/29</link><generator>RSS for Node</generator><lastBuildDate>Mon, 11 May 2026 00:10:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/category/29.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 11 Jun 2024 17:48:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[C# Bücher]]></title><description><![CDATA[Ich habe mal spaßeshalber folgendes Tutorial erstellt. Über 90% davon wurden mit chatGPT gebastelt. Die Programme laufen (alles getestet).
https://www.henkessoft.de/Csharp/Csharp - 1.htm
]]></description><link>https://www.c-plusplus.net/forum/topic/300773/c-bücher</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/300773/c-bücher</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Tue, 11 Jun 2024 17:48:22 GMT</pubDate></item><item><title><![CDATA[Neues im Magazin]]></title><description><![CDATA[Du hast offenbar ein Projekt mit vorkompilierten Headern gemacht. Wenn du nicht weißt, was das ist, solltest du es halt beim Erstellen des Projektes auch nicht anwählen; Microsoft kann da gar nichts dafür. Mach am besten ein neues Projekt und diesmal ohne Precompiled Headers...
]]></description><link>https://www.c-plusplus.net/forum/topic/269195/neues-im-magazin</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/269195/neues-im-magazin</guid><dc:creator><![CDATA[katelara]]></dc:creator><pubDate>Tue, 28 Jan 2014 06:01:36 GMT</pubDate></item><item><title><![CDATA[Datenbereich (Pointer) =&gt; json]]></title><description><![CDATA[@worst_case sagte in Datenbereich (Pointer) =&gt; json:

dictonary

Endlich Thunfisch ! 
]]></description><link>https://www.c-plusplus.net/forum/topic/355434/datenbereich-pointer-json</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355434/datenbereich-pointer-json</guid><dc:creator><![CDATA[Lupus-SLE]]></dc:creator><pubDate>Sat, 07 Feb 2026 10:39:36 GMT</pubDate></item><item><title><![CDATA[Zahlen mit Anzahl Nachkommastellen]]></title><description><![CDATA[Sogar, wenn man die Vor- und Nachkommastellen auf 9 begrenzt, kommt man dabei auf keinen grünen Zweig:
import static org.junit.jupiter.api.Assertions.*;

import org.junit.jupiter.api.Test;

class NumbersToolTest {
  @Test
  void formatNumber_0_exceptions() {
    assertThrows(IllegalArgumentException.class, () -&gt; NumbersTool.formatNumber(123.12, -1, ','));
    assertThrows(IllegalArgumentException.class, () -&gt; NumbersTool.formatNumber(123.12, 0, ','));
    assertThrows(IllegalArgumentException.class, () -&gt; NumbersTool.formatNumber(123.12, 10, ','));
    assertThrows(IllegalArgumentException.class, () -&gt; NumbersTool.formatNumber(123.12, 11, ','));

    assertThrows(
        IllegalArgumentException.class,
        () -&gt; NumbersTool.formatNumber(Math.nextDown(-1e10), 2, ','));
    assertThrows(IllegalArgumentException.class, () -&gt; NumbersTool.formatNumber(-1e10, 2, ','));
    assertThrows(IllegalArgumentException.class, () -&gt; NumbersTool.formatNumber(1e10, 2, ','));
    assertThrows(
        IllegalArgumentException.class, () -&gt; NumbersTool.formatNumber(Math.nextUp(1e10), 2, ','));
  }

  @Test
  void formatNumber_1_shortNumbers() {
    double n1 = 123.12;
    String s1 = &quot;123,120000000&quot;;
    for (int i = 1; i &lt;= 9; i++) {
      assertEquals(s1.substring(0, 4 + i), NumbersTool.formatNumber(n1, i, ','));
    }

    double n2 = 123;
    for (int i = 1; i &lt;= 9; i++) {
      assertEquals(&quot;123,&quot; + &quot;0&quot;.repeat(i), NumbersTool.formatNumber(n2, i, ','));
    }

    double n3 = -1;
    for (int i = 1; i &lt;= 9; i++) {
      assertEquals(&quot;-1,&quot; + &quot;0&quot;.repeat(i), NumbersTool.formatNumber(n3, i, ','));
    }

    double n4 = 1;
    for (int i = 1; i &lt;= 9; i++) {
      assertEquals(&quot;1,&quot; + &quot;0&quot;.repeat(i), NumbersTool.formatNumber(n4, i, ','));
    }

    double n5 = -0.5;
    String s5 = &quot;-0,500000000&quot;;
    for (int i = 1; i &lt;= 9; i++) {
      assertEquals(s5.substring(0, 3 + i), NumbersTool.formatNumber(n5, i, ','));
    }

    double n6 = 0.5;
    String s6 = &quot;0,500000000&quot;;
    for (int i = 1; i &lt;= 9; i++) {
      assertEquals(s6.substring(0, 2 + i), NumbersTool.formatNumber(n6, i, ','));
    }
  }

  @Test
  void formatNumber_2_longNumber() {
    double n = Math.PI;
    String s = &quot;3,14159265358979323846&quot;;
    for (int i = 1; i &lt;= 9; i++) {
      assertEquals(s.substring(0, 2 + i), NumbersTool.formatNumber(n, i, ','));
    }
  }

  @Test
  void formatNumber_3_negativeNumber() {
    double n = -1.9911;
    String s = &quot;-1,991100000&quot;;
    for (int i = 1; i &lt;= 9; i++) {
      assertEquals(s.substring(0, 3 + i), NumbersTool.formatNumber(n, i, ','));
    }
  }

  @Test
  void formatNumber_4_zero() {
    double n = 0;
    for (int i = 1; i &lt;= 9; i++) {
      assertEquals(&quot;0,&quot; + &quot;0&quot;.repeat(i), NumbersTool.formatNumber(n, i, ','));
    }
  }

  @Test
  void formatNumber_5_edgeCaseLargeDecimalPlaces() {
    double n = 1.0 / 3.0; // 0.3333333333333333...
    for (int i = 1; i &lt;= 9; i++) {
      assertEquals(&quot;0,&quot; + &quot;3&quot;.repeat(i), NumbersTool.formatNumber(n, i, ','));
    }
  }

  @Test
  void formatNumber_6_edgeCaseVerySmallNumber() {
    double n1 = 0.000000001;
    for (int i = 1; i &lt;= 8; i++) {
      assertEquals(&quot;0,&quot; + &quot;0&quot;.repeat(i), NumbersTool.formatNumber(n1, i, ','));
    }
    assertEquals(&quot;0,000000001&quot;, NumbersTool.formatNumber(n1, 9, ','));

    double n2 = -0.000000001;
    for (int i = 1; i &lt;= 8; i++) {
      assertEquals(&quot;0,&quot; + &quot;0&quot;.repeat(i), NumbersTool.formatNumber(n2, i, ','));
    }
    assertEquals(&quot;-0,000000001&quot;, NumbersTool.formatNumber(n2, 9, ','));

    double n3 = 0.00000000111;
    for (int i = 1; i &lt;= 8; i++) {
      assertEquals(&quot;0,&quot; + &quot;0&quot;.repeat(i), NumbersTool.formatNumber(n3, i, ','));
    }
    assertEquals(&quot;0,000000001&quot;, NumbersTool.formatNumber(n3, 9, ','));

    double n4 = -0.00000000111;
    for (int i = 1; i &lt;= 8; i++) {
      assertEquals(&quot;0,&quot; + &quot;0&quot;.repeat(i), NumbersTool.formatNumber(n4, i, ','));
    }
    assertEquals(&quot;-0,000000001&quot;, NumbersTool.formatNumber(n4, 9, ','));

    double n5 = 0.99999999999;
    for (int i = 1; i &lt;= 9; i++) {
      assertEquals(&quot;0,&quot; + &quot;9&quot;.repeat(i), NumbersTool.formatNumber(n5, i, ','));
    }

    double n6 = -0.99999999999;
    for (int i = 1; i &lt;= 9; i++) {
      assertEquals(&quot;-0,&quot; + &quot;9&quot;.repeat(i), NumbersTool.formatNumber(n6, i, ','));
    }

    double n7 = 0.99999999999999;
    for (int i = 1; i &lt;= 9; i++) {
      assertEquals(&quot;0,&quot; + &quot;9&quot;.repeat(i), NumbersTool.formatNumber(n7, i, ','));
    }

    double n8 = -0.99999999999999;
    for (int i = 1; i &lt;= 9; i++) {
      assertEquals(&quot;-0,&quot; + &quot;9&quot;.repeat(i), NumbersTool.formatNumber(n8, i, ','));
    }
  }

  @Test
  void formatNumber_7_edgeCaseRounding() {
    double n = 2.675; // known floating point issue
    String s = &quot;2,675000000&quot;;
    for (int i = 1; i &lt;= 9; i++) {
      // will fail at i &gt;= 8
      assertEquals(s.substring(0, 2 + i), NumbersTool.formatNumber(n, i, ','));
    }

    double n2 = -2.675; // known floating point issue
    String s2 = &quot;-2,675000000&quot;;
    for (int i = 1; i &lt;= 9; i++) {
      // will fail at i &gt;= 8
      assertEquals(s2.substring(0, 3 + i), NumbersTool.formatNumber(n2, i, ','));
    }
  }

  @Test
  void formatNumber_8_edgeCaseBigNumbers() {
    double n1 = 999999999.0; // 9 nines before decimal point
    for (int i = 1; i &lt;= 9; i++) {
      // will fail at 8 and 9 decimal places
      assertEquals(&quot;999999999,&quot; + &quot;0&quot;.repeat(i), NumbersTool.formatNumber(n1, i, ','));
    }

    double n2 = -999999999.0; // 9 nines before decimal point
    for (int i = 1; i &lt;= 9; i++) {
      // will fail at 8 and 9 decimal places
      assertEquals(&quot;-999999999,&quot; + &quot;0&quot;.repeat(i), NumbersTool.formatNumber(n2, i, ','));
    }

    double n3 = 999999999.999999999; // 9 nines before decimal point, 9 nines after decimal point
    for (int i = 1; i &lt;= 9; i++) {
      // will fail immediately at i &gt;= 1
      assertEquals(&quot;999999999,&quot; + &quot;9&quot;.repeat(i), NumbersTool.formatNumber(n3, i, ','));
    }
  }
}

Test 7 und 8 werden immer failen.
Aber man kann in C-Sharp ja einfach Math.Round verwenden: https://stackoverflow.com/questions/257005/how-do-you-round-a-number-to-two-decimal-places
auch wenn ich nicht sicher bin, ob das auch mit 0en auffüllt - oder nur rundet. (/monolog-ende)
]]></description><link>https://www.c-plusplus.net/forum/topic/355392/zahlen-mit-anzahl-nachkommastellen</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355392/zahlen-mit-anzahl-nachkommastellen</guid><dc:creator><![CDATA[Lennox]]></dc:creator><pubDate>Tue, 25 Nov 2025 10:18:43 GMT</pubDate></item><item><title><![CDATA[C# Signalhandler]]></title><description><![CDATA[Evtl. über AppDomain.CurrentDomain.ProcessExit, s.a. Graceful Shutdown C# Apps?
Ich habe C# noch nicht unter Linux ausprobiert.
]]></description><link>https://www.c-plusplus.net/forum/topic/355383/c-signalhandler</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355383/c-signalhandler</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Sun, 09 Nov 2025 10:31:00 GMT</pubDate></item><item><title><![CDATA[Intervall erzeugen]]></title><description><![CDATA[OK,verstanden
]]></description><link>https://www.c-plusplus.net/forum/topic/355384/intervall-erzeugen</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355384/intervall-erzeugen</guid><dc:creator><![CDATA[worst_case]]></dc:creator><pubDate>Sun, 09 Nov 2025 08:43:44 GMT</pubDate></item><item><title><![CDATA[Suche mit indexof]]></title><description><![CDATA[.. super,
Vielen Dank
]]></description><link>https://www.c-plusplus.net/forum/topic/355381/suche-mit-indexof</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355381/suche-mit-indexof</guid><dc:creator><![CDATA[worst_case]]></dc:creator><pubDate>Sun, 02 Nov 2025 09:42:56 GMT</pubDate></item><item><title><![CDATA[Objektverweis erforderlich]]></title><description><![CDATA[Hallo,
ich versuche nach Jahren C, und das ist auch schon 10 Jahre her, mir C# unter Linux für ein Projekt anzueignen.
Da stößt das greenhorn natürlich auf die ersten Wiederstände 
Ich möchte eine SQL Verbindung aufbauen und den Rückgabewert in &quot;connecetion&quot; public zu speichern,
um dies bei lese/schreib-Zugriffen (noch zu erstellende zusätzliche Funktionen) auf die Datenbank wiederverwerten zu können.
namespace ConnectSql
{
	using MySql.Data.MySqlClient;
	
//#######################################################################################################
	public class sqlProgramm
	{
		public MySqlConnection connection;
		public static bool opensql()
		{
			// Ihr Datenbank-Verbindungsstring
			string connectionString = &quot;server=localhost;database=visualdb;uid=visualdbuser;password=visualdbuserpw;&quot;;

			connection = new MySqlConnection(connectionString);
			{
				try
				{
					connection.Open();
					Console.WriteLine(&quot;Verbindung zur MySQL-Datenbank erfolgreich hergestellt!&quot;);
					return true;
				}
				catch (Exception ex)
				{
					Console.WriteLine($&quot;Fehler bei der Verbindung: {ex.Message}&quot;);
					return false;
				}
			}
		}

//#######################################################################################################			
		public static bool readspsliste(string ipaddresse)
		{
			string sql = &quot;SELECT * FROM spsliste WHERE ip = ipadresse&quot;;

			MySqlCommand cmd = new MySqlCommand(sql, connection);
			MySqlDataReader rdr = cmd.ExecuteReader();

			while (rdr.Read())
			{
				Console.WriteLine(rdr[0] + &quot; -- &quot; + rdr[1]);
			}

			rdr.Close();

			return true;
		}
//#######################################################################################################		
	}
}

Hier kommt nachfolgende Fehlermeldung:
Error CS0120 : Für das nicht statische Feld, die Methode oder die Eigenschaft &quot;sqlProgramm.connection&quot; ist ein Objektverweis erforderlich.
(Dies kommt für jede Zeile in der &quot;connection&quot; benutzt wird)
Ich verstehe dies nicht, ich bin doch in der selben Klasse ... warum ??
Vielen Dank !!
Gruß piet
]]></description><link>https://www.c-plusplus.net/forum/topic/355378/objektverweis-erforderlich</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355378/objektverweis-erforderlich</guid><dc:creator><![CDATA[worst_case]]></dc:creator><pubDate>Thu, 23 Oct 2025 06:15:29 GMT</pubDate></item><item><title><![CDATA[PDF Factur-X]]></title><description><![CDATA[Hallo,
ich suche nach einer Lösung um ein eingebettetes Factur-X (E-Rechnung) aus einer PDF zu lesen. Alle Beispiele, die ich finden konnte funktionieren nicht. Wäre echt cool, wenn mir jemand helfen könnte,
Danke Euch 
]]></description><link>https://www.c-plusplus.net/forum/topic/355364/pdf-factur-x</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355364/pdf-factur-x</guid><dc:creator><![CDATA[HerrRatlose]]></dc:creator><pubDate>Sun, 21 Sep 2025 19:24:27 GMT</pubDate></item><item><title><![CDATA[Geschwindigkeit bei]]></title><description><![CDATA[Ich bin von System.Speech (alte Voices), bei denen man die Geschwindigkeit von -10 bis +10 einstellen konnte, auf die erweiterten/neueren Windows-Runtime-Voices (kostenlos in den Sprachpaketen bei Windows 10/11 enthalten) umgestiegen. Allerdings ist die Geschwindigkeitseinstellung hier sehr grob. Man kann in meinem Programm fast nur den Wert &quot;0&quot; für &quot;Rate&quot; nutzen, mit Einschränkungen &quot;-1&quot;. Microsoft hat hier angeblich ein abgespecktes SSML umgesetzt. SSML benötige ich, um die Zeichensetzung in natürlich wirkende Pausen zu verwandeln. Kann ich diese Beschränkung überwinden/umgehen, ohne auf  Azure Cognitive Services TTS (Nachteil: Cloud, API-Key, Kosten) umzusteigen?
private string ConvertToSsml(string text, string cultureCode, VoiceInformation? voice, int rate)
{
    // Text sicher machen + leichte Prosodie (optional)
    string ssmlSafe = EscapeForSsml(text);

    // Leichte Pausen bei typischen Satzzeichen (aber KEIN Eingriff bei „¿“)
    ssmlSafe = ssmlSafe.Replace(&quot;,&quot;, &quot;&lt;break time='50ms'/&gt;&quot;)
                       .Replace(&quot;;&quot;, &quot;&lt;break time='50ms'/&gt;&quot;)
                       .Replace(&quot;:&quot;, &quot;&lt;break time='50ms'/&gt;&quot;)
                       .Replace(&quot;.&quot;, &quot;&lt;break time='50ms'/&gt;&quot;)
                       .Replace(&quot;!&quot;, &quot;&lt;break time='50ms'/&gt;&quot;)
                       .Replace(&quot;¡&quot;, &quot;¡&lt;break time='20ms'/&gt;&quot;);
    // ❌ kein Replace für '¿'

    string trimmed = text.Trim();
    if (trimmed.EndsWith(&quot;?&quot;))
    { 
        ssmlSafe = $&quot;&lt;prosody pitch='+15%'&gt;{ssmlSafe}&lt;/prosody&gt;&quot;;
    }
    else if (trimmed.EndsWith(&quot;!&quot;))
    { 
        ssmlSafe = $&quot;&lt;prosody volume='loud'&gt;{ssmlSafe}&lt;/prosody&gt;&quot;;
    }

    // Stimme explizit festlegen
    string voiceName = voice?.DisplayName ?? &quot;&quot;;
    string voiceLang = voice?.Language ?? cultureCode;

    string ssmlRate = rate switch
    {
        &lt;= -2  =&gt; &quot;x-slow&quot;,
        -1     =&gt; &quot;slow&quot;,                
        0      =&gt; &quot;medium&quot;,
        1      =&gt; &quot;fast&quot;,
        &gt;= 2   =&gt; &quot;x-fast&quot;,
    };

    return $@&quot;
    &lt;speak version='1.0' xml:lang='{cultureCode}'&gt;
      &lt;voice name='{EscapeForSsml(voiceName)}' xml:lang='{voiceLang}'&gt;
        &lt;prosody rate='{ssmlRate}'&gt;{ssmlSafe}&lt;/prosody&gt;
      &lt;/voice&gt;
    &lt;/speak&gt;&quot;;
}

]]></description><link>https://www.c-plusplus.net/forum/topic/355358/geschwindigkeit-bei</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355358/geschwindigkeit-bei</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Thu, 18 Sep 2025 11:03:49 GMT</pubDate></item><item><title><![CDATA[Gemischte Aufnahme - wie Echo unterdrücken?]]></title><description><![CDATA[@Erhard-Henkes sagte in Gemischte Aufnahme - wie Echo unterdrücken?:

@Th69 sagte in Gemischte Aufnahme - wie Echo unterdrücken?:

Wann tritt dieses Problem nicht auf?

Das ist eine interessante Herangehensweise bei Sackgassen.

Ich habe mal viel Zeit darauf verschwendet, einen kurzen &quot;Aussetzer&quot; in Code für Video-Playback zu beheben. Irgendwann ist mir dann aufgefallen, dass der Aussetzer in das Video eincodiert war. Da hätte mir diese Frage auf jeden Fall weitergeholfen 
]]></description><link>https://www.c-plusplus.net/forum/topic/355354/gemischte-aufnahme-wie-echo-unterdrücken</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355354/gemischte-aufnahme-wie-echo-unterdrücken</guid><dc:creator><![CDATA[Finnegan]]></dc:creator><pubDate>Mon, 15 Sep 2025 22:08:22 GMT</pubDate></item><item><title><![CDATA[Antialias bei Region]]></title><description><![CDATA[Danke Dir Th69 !
]]></description><link>https://www.c-plusplus.net/forum/topic/355343/antialias-bei-region</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355343/antialias-bei-region</guid><dc:creator><![CDATA[biter]]></dc:creator><pubDate>Wed, 20 Aug 2025 06:11:37 GMT</pubDate></item><item><title><![CDATA[Mail-Client mit TLS]]></title><description><![CDATA[Das hatte ich dir doch schon vor einer Woche geschrieben!
@Th69 sagte in Mail-Client mit TLS:

Und Windows 10 / 11 hat doch auch schon CURL installiert: curl shipped by Microsoft

]]></description><link>https://www.c-plusplus.net/forum/topic/355324/mail-client-mit-tls</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355324/mail-client-mit-tls</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Tue, 01 Jul 2025 15:38:42 GMT</pubDate></item><item><title><![CDATA[Styles zur Laufzeit nachladen greift nicht]]></title><description><![CDATA[N' Abend,
nun habe ich es geschafft, das Problem ist vermutlich zweierlei.
Erstens, einige Zeilen auskommentieren:
&lt;UserControl x:Class=&quot;DotNet.WpfControls.Base.Label&quot;
             xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
             xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
             xmlns:mc=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot; 
             xmlns:d=&quot;http://schemas.microsoft.com/expression/blend/2008&quot; 
             xmlns:local=&quot;clr-namespace:DotNet.WpfControls.Base&quot;
             mc:Ignorable=&quot;d&quot;&gt;

	&lt;!--&lt;UserControl.Resources&gt;
		&lt;ResourceDictionary&gt;
			&lt;ResourceDictionary.MergedDictionaries&gt;
				&lt;ResourceDictionary Source=&quot;Resources/Styles/DefaultStyles.xaml&quot;/&gt;
				&lt;ResourceDictionary Source=&quot;Resources/Styles/Label.xaml&quot;/&gt;
			&lt;/ResourceDictionary.MergedDictionaries&gt;
		&lt;/ResourceDictionary&gt;
	&lt;/UserControl.Resources&gt;--&gt;

	&lt;Grid&gt;
		&lt;Grid.ColumnDefinitions&gt;
			&lt;ColumnDefinition Name=&quot;LabelColumn&quot; /&gt;
			&lt;ColumnDefinition /&gt;
		&lt;/Grid.ColumnDefinitions&gt;
		&lt;Grid.RowDefinitions&gt;
			&lt;RowDefinition /&gt;
		&lt;/Grid.RowDefinitions&gt;

		&lt;TextBlock Grid.Column=&quot;0&quot; Grid.Row=&quot;0&quot; Margin=&quot;4, 2, 4, 2&quot; Name=&quot;InternalName&quot; Style=&quot;{DynamicResource LabelName}&quot; Text=&quot;Name&quot; /&gt;
		&lt;TextBlock Grid.Column=&quot;1&quot; Grid.Row=&quot;0&quot; Margin=&quot;4, 2, 4, 2&quot; Name=&quot;InternalValue&quot; Style=&quot;{DynamicResource LabelValue}&quot; Text=&quot;Value&quot; /&gt;
	&lt;/Grid&gt;
&lt;/UserControl&gt;


Zweitens, die Lademethode leicht anpassen:
private void LoadStyles()
{
	var currentDirectory = Environment.CurrentDirectory;
	var styles = new List&lt;string&gt;()
	{
		&quot;DefaultStyles.xaml&quot;,
		&quot;Label.xaml&quot;
	};

	App.Current.Resources.Clear();

	foreach (var item in styles)
	{
		var pathName = Path.Combine(currentDirectory, ResourcesPathName, StylesPathName, item);
		var resourceDictionary = new ResourceDictionary
		{
			Source = new Uri(pathName)
		};

		App.Current.Resources.MergedDictionaries.Add(resourceDictionary);
	}
}

Und man muss &lt;DynamicResource&gt; anstatt von &lt;StaticResource&gt; verwenden.
VG Torsten
]]></description><link>https://www.c-plusplus.net/forum/topic/355180/styles-zur-laufzeit-nachladen-greift-nicht</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355180/styles-zur-laufzeit-nachladen-greift-nicht</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Fri, 03 Jan 2025 19:55:13 GMT</pubDate></item><item><title><![CDATA[Property Basics]]></title><description><![CDATA[@SideWinder
Danke für die Info. Wir haben Properties nun verstanden.
]]></description><link>https://www.c-plusplus.net/forum/topic/355157/property-basics</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355157/property-basics</guid><dc:creator><![CDATA[Quiche Lorraine]]></dc:creator><pubDate>Wed, 11 Dec 2024 10:49:41 GMT</pubDate></item><item><title><![CDATA[C# Exponenten in RichTextBox]]></title><description><![CDATA[Habe meinen saublöden Fehler gefunden. Hinter a.ToString haben die () Klammern gefehlt. Es geht jetzt.
]]></description><link>https://www.c-plusplus.net/forum/topic/355153/c-exponenten-in-richtextbox</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355153/c-exponenten-in-richtextbox</guid><dc:creator><![CDATA[micha7]]></dc:creator><pubDate>Sat, 30 Nov 2024 17:47:30 GMT</pubDate></item><item><title><![CDATA[C# WPF externes Resource Dictionary?]]></title><description><![CDATA[Hallo,
okay, schaue ich mir an. Vielen Dank.
VG Torsten
]]></description><link>https://www.c-plusplus.net/forum/topic/355121/c-wpf-externes-resource-dictionary</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355121/c-wpf-externes-resource-dictionary</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Mon, 04 Nov 2024 15:06:16 GMT</pubDate></item><item><title><![CDATA[Visual Studio: Projekt kopieren und mit der Kopie weiterarbeiten]]></title><description><![CDATA[Auch wenn es schon 3 Jahre her ist, möchte ich für diesen Post bedanken, weil ich eine ganze weile nach einer solchen Möglichkeit gesucht habe. Ein Kleinigkeit hat sich geändert. Bei mir ist der Punkt &quot;Vorlage exportieren&quot; nicht unter Datei, sondern unter &quot;Projekt&quot; zu finden. Ansonsten hat alles genau so geklappt wie hier beschrieben. Das hat mir ne Menge Zeit gespart.
]]></description><link>https://www.c-plusplus.net/forum/topic/342087/visual-studio-projekt-kopieren-und-mit-der-kopie-weiterarbeiten</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/342087/visual-studio-projekt-kopieren-und-mit-der-kopie-weiterarbeiten</guid><dc:creator><![CDATA[Musikus]]></dc:creator><pubDate>Sun, 03 Nov 2024 14:51:48 GMT</pubDate></item><item><title><![CDATA[C# und WinForms am Beispiel Schiffe versenken (Battleship) mit KI-Gegner]]></title><description><![CDATA[Creating a Battleship game using C# and WinForms can be a fun and educational project, especially if you want to implement AI opponents. Below is a simple example that outlines how to structure the project and some key components you can include.
Overview of the Game
Battleship is a strategy game where players take turns guessing the locations of each other's ships on a grid. For the AI opponent, we can implement a simple algorithm to make guesses.
Key Components
Game Board
A grid to represent the game board where players can place their ships and make guesses.
Ship Placement
Logic to allow players and AI to place their ships on the board.
Guessing Mechanism
Players and AI take turns guessing the location of ships.
AI Logic
A simple algorithm for the AI to make guesses (random or more sophisticated).
Step-by-Step Implementation

Set Up Your WinForms Project
Open Visual Studio and create a new WinForms App (.NET Framework) project.
Design the UI
Use a DataGridView or multiple Buttons to represent the game board for both the player and AI.
Include buttons for starting the game, placing ships, and making guesses.
Add labels or text boxes for displaying messages (e.g., &quot;Hit!&quot;, &quot;Miss!&quot;, &quot;AI's Turn&quot;).

]]></description><link>https://www.c-plusplus.net/forum/topic/355039/c-und-winforms-am-beispiel-schiffe-versenken-battleship-mit-ki-gegner</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355039/c-und-winforms-am-beispiel-schiffe-versenken-battleship-mit-ki-gegner</guid><dc:creator><![CDATA[LocksmithMons1]]></dc:creator><pubDate>Tue, 24 Sep 2024 18:24:42 GMT</pubDate></item><item><title><![CDATA[Object synchronization method was called from an unsynchronized block of code.]]></title><description><![CDATA[@TorDev sagte in Object synchronization method was called from an unsynchronized block of code.:

Ich muss dazu sagen, dass ich im originalen Programm einen Timeout beim Mutex mitgebe, und genau der tritt nämlich auf.

Siehste, und genau deswegen sollte man nie modifizierten Code posten. Auf ein minimales Beispiel reduzieren, ja, das ist gut. Aber der Fehler muss dabei halt noch auftreten.
]]></description><link>https://www.c-plusplus.net/forum/topic/355057/object-synchronization-method-was-called-from-an-unsynchronized-block-of-code</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355057/object-synchronization-method-was-called-from-an-unsynchronized-block-of-code</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Fri, 30 Aug 2024 22:29:59 GMT</pubDate></item><item><title><![CDATA[C# und WinForms am Beispiel Pong]]></title><description><![CDATA[https://www.henkessoft.de/Windows Forms/Windows Forms Csharp - 1.htm#Pong
Interessante und überschaubare Basisversion für Einsteiger, die das gerne ausbauen wollen. Vor allem der AI Bereich ist sehr einfach gestrickt, damit der Mensch eine Chance hat. 
Pong ist eines der ersten und bekanntesten Videospiele (1972 von Atari entwickelt).
Ist die Aufteilung der Module/Klassen in Form, AI, Ball, GameEngine, Paddle ausreichend?
Wie könnte man die AI Strategie schleichend verstärken, ohne dass der Mensch chancenlos wird? Vielleicht adaptiv in Abhängigkeit vom Punktestand?
]]></description><link>https://www.c-plusplus.net/forum/topic/355059/c-und-winforms-am-beispiel-pong</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355059/c-und-winforms-am-beispiel-pong</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Wed, 28 Aug 2024 13:41:00 GMT</pubDate></item><item><title><![CDATA[C# und WinForms am Beispiel Pong]]></title><description><![CDATA[https://www.henkessoft.de/Windows Forms/Windows Forms Csharp - 1.htm#Pong
Pong ist der Klassiker überhaupt, daher ein MUSS.
]]></description><link>https://www.c-plusplus.net/forum/topic/355054/c-und-winforms-am-beispiel-pong</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355054/c-und-winforms-am-beispiel-pong</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Tue, 27 Aug 2024 13:58:59 GMT</pubDate></item><item><title><![CDATA[C# und WinForms am Beispiel Snake]]></title><description><![CDATA[Snake ist ein Klassiker. Hier beschreibe ich zunächst die Programmierung einer Basisversion für dieses immer hektischer werdende Spiel.
https://www.henkessoft.de/Windows Forms/Windows Forms Csharp - 1.htm#Snake
Empfindet ihr die Aufteilung in Game und Form ausreichend?
]]></description><link>https://www.c-plusplus.net/forum/topic/355050/c-und-winforms-am-beispiel-snake</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355050/c-und-winforms-am-beispiel-snake</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Sun, 25 Aug 2024 22:54:01 GMT</pubDate></item><item><title><![CDATA[C# und WinForms am Beispiel Pixel Maze Challenge]]></title><description><![CDATA[@Th69 sagte in C# und WinForms am Beispiel Pixel Maze Challenge:

Bzgl. der Codewiederholungen für pointX und obstacleX

Ich wollte es zunächst einfach halten, habe mit 6 Schätzen und 2 Hindernissen begonnen. Die KI erzeugt wiederholenden Code ruckzuck. Man braucht aber mindestens 8 Schätze und 3 Hindernisse, um es spannend zu machen. Ich habe da noch weitere Ideen für ein Spiel mit mehreren Runden (Zeit verkürzen, mehr Hindernisse, mehr Schätze, Power-Ups (Unbesiegbarkeit, Punkte-Multiplikatoren oder Zeitverlängerungen), unsichtbare Fallen, ...). Schöne Bildchen wären auch lustig, etc.
Aufwand lohnt sich jedoch nur, wenn das Spielprinzip in dieser konkreten Form wirklich interessant ist.
]]></description><link>https://www.c-plusplus.net/forum/topic/355048/c-und-winforms-am-beispiel-pixel-maze-challenge</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355048/c-und-winforms-am-beispiel-pixel-maze-challenge</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Sun, 25 Aug 2024 12:49:16 GMT</pubDate></item><item><title><![CDATA[C# und WinForms am Beispiel Mastermind]]></title><description><![CDATA[@Erhard-Henkes Oh, meine Eltern hatten das als Brettspiel zu Hause, da werde ich bei Zeit bestimmt mal rein schauen
]]></description><link>https://www.c-plusplus.net/forum/topic/355046/c-und-winforms-am-beispiel-mastermind</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355046/c-und-winforms-am-beispiel-mastermind</guid><dc:creator><![CDATA[Schlangenmensch]]></dc:creator><pubDate>Sat, 24 Aug 2024 17:45:45 GMT</pubDate></item><item><title><![CDATA[Serieller Port lässt sich nicht öffnen]]></title><description><![CDATA[@Erhard-Henkes
Auch müsste man mal das Verhalten von den USB Ports untersuchen. Habe schon erlebt dass je nach USB Port Geräte erkannt werden oder nicht.
]]></description><link>https://www.c-plusplus.net/forum/topic/355034/serieller-port-lässt-sich-nicht-öffnen</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/topic/355034/serieller-port-lässt-sich-nicht-öffnen</guid><dc:creator><![CDATA[Quiche Lorraine]]></dc:creator><pubDate>Mon, 19 Aug 2024 09:28:58 GMT</pubDate></item></channel></rss>