Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Drag & Drop beliebiges Objekt?

Empfohlene Antworten

Veröffentlicht

Hi an alle,

Ich hab ein ganz verzwicktes Problem!

Ich benutze für mein Projekt nun Drag & Drop wie ihr am Sourcecode sehen könnt.


private: System::Void listView1_MouseDown(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e) {

			 if( listView1->SelectedItems->Count != 0 )

			 {

				 if ( listView1->SelectedItems[0]->Text == "If-Anweisung" ) 

				 {

					 listView1->DoDragDrop("If-Anweisung", DragDropEffects::All );

				 }

				 if ( listView1->SelectedItems[0]->Text == "While-Schleife" )

				 {

					 listView1->DoDragDrop("While-Schleife", DragDropEffects::All);

				 }

			 }

		 }

und zum zweiten

	private: System::Void Main_DragDrop(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e) {

				 if( e->Data->GetData(DataFormats::Text)->ToString() == "If-Anweisung" )

					 this->AddElement(this->panel1, gcnew IfAnweisung());

				 if( e->Data->GetData(DataFormats::Text)->ToString() == "While-Schleife" )

					 this->AddElement(this->panel1, gcnew WhileSchleife());


				 if(this->Controls->Count > 1)

					 this->sizeNewControls(this->panel1);

			 }

Nun möchte ich aber dieses ewige vergleichen ob es eine "If-Anweisung" oder eine "While-Schleife" ist vermeiden.

Darum möchte ich gerne wissen ob es möglich ist in dem Event "DragDrop" ein übergebenes Steuerelement, in der Methode DoDragDrop(), wieder rauszubekommen! Den DataFormats bietet nicht das was ich brauche!

Wenn das nicht geht nennt mir bitte Alternativen!

Zu Info:

IfAnweisung und WhileSchleife sind eigene Steuerelmente

Hoffentlich hab ich alles verständlich geschrieben!

MfG

CTom

Kann mir dann vll jemand ein Beispiel geben oder eine Seite! In dem Beschrieben wird, wie Events Vererbt werden?

MfG

CTom

Ok! Hat sich alles erledigt ^^

Thread Close pls !!

:mod:

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.