Ich hab ein Problem bei position in der Registry speichern.
-
Hi alle zusammen
Ich hab ein kleines problem und zwar möchte ich positionen von der Toolbar in der Registry Speichern. Er geht auch soweit alles ohne Fehler durch. Durch das Debuggen habe ich auch gesehen das er die Werte ändert usw. Aber warum Speichert er die Positionen nicht?
Hier der Code von Form Load:
String^ _toolBarState = (String^)Registry::GetValue("HKEY_CURRENT_USER\\RB-Softarticle\\ChemSign\\NewEnter","ToolBarNewEnterState",""); //Wert aus Registry ausgeben if(_toolBarState != nullptr) //ToolBar registry eintrag auf null überprüfen { this->toolStrip1->Top::set(Convert::ToInt32(Registry::GetValue("HKEY_CURRENT_USER\\RB-Softarticle\\ChemSign\\toolStripContainer1","ToolBarNewEnterTop","Top"))); //obere Position an die Toolbar übergeben this->toolStrip1->Left::set(Convert::ToInt32(Registry::GetValue("HKEY_CURRENT_USER\\RB-Softarticle\\ChemSign\\toolStripContainer1","ToolBarNewEnterLeft","Left")));//linke Position an die Toolbar übergeben this->toolStrip2->Top::set(Convert::ToInt32(Registry::GetValue("HKEY_CURRENT_USER\\RB-Softarticle\\ChemSign\\toolStripContainer2","ToolBar1NewEnterTop","Top")));//obere Position für die 2 Toolbar übergeben this->toolStrip2->Left::set(Convert::ToInt32(Registry::GetValue("HKEY_CURRENT_USER\\RB-Softarticle\\ChemSign\\toolStripContainer2","ToolBar1NewEnterLeft","Left")));//linke Position für die 2 Toolbar übergeben }
und das ist der Code vom Form Closing:
Registry::SetValue("HKEY_CURRENT_USER\\RB-Softarticle\\ChemSign\\toolStripContainer1","ToolBarNewEnterState",(this->WindowState::get())); Registry::SetValue("HKEY_CURRENT_USER\\RB-Softarticle\\ChemSign\\toolStripContainer1","ToolBarNewEnterTop",(this->toolStrip1->Top)); Registry::SetValue("HKEY_CURRENT_USER\\RB-Softarticle\\ChemSign\\toolStripContainer1","ToolBarNewEnterLeft",(this->toolStrip1->Left)); Registry::SetValue("HKEY_CURRENT_USER\\RB-Softarticle\\ChemSign\\toolStripContainer2","ToolBar1NewEnterTop",(this->toolStrip2->Top)); Registry::SetValue("HKEY_CURRENT_USER\\RB-Softarticle\\ChemSign\\toolStripContainer2","ToolBar1NewEnterLeft",(this->toolStrip2->Left));
Gruß Sebastian