Problem mit +TextBox1->Text



  • Malarkey. schrieb:

    Edit: ach soo, das mit den // soll wech, dachte die wären ausversehen :p

    ok thx 🙂

    Das kannst Du auch lassen.. das ist dann auskommentiert.
    Der Kompiler beachtet es nicht...



  • So, sry dass ich euch noch mal Nerve...

    Habe jetzt eine domainUpDown eingefügt un möchte den Benutzer auswählen lassen ob die Seite In oder Extern geöffnet werden soll. Hab da auch schon ne Idee mit If

    Also

    If (domainupdown steht auf INTERn)

    { Dann blabla}

    If (Domainupdown auf Extern)

    {blabla

    }

    Doch wie Spreche ich dieses domainupdown an? Die einzelnen Angaben Intern und Extern sind in einem Text nur durch / getrennt...

    Was nun?

    Kompletter Code:

    #pragma once
    #include <iostream>
    #include <conio.h>
    #include <windows.h>
    #include <string> 
    #include <shellapi.h> 
    #include <stdlib.h>
    #include <stdio.h>
    #include <time.h>
    
    namespace Website {
    
    	using namespace System;
    	using namespace System::ComponentModel;
    	using namespace System::Collections;
    	using namespace System::Windows::Forms;
    	using namespace System::Data;
    	using namespace System::Drawing;
    	using namespace std;
    
    	/// <summary>
    	/// Zusammenfassung für Form1
    	///
    	/// Warnung: Wenn Sie den Namen dieser Klasse ändern, müssen Sie auch
    	///          die Ressourcendateiname-Eigenschaft für das Tool zur Kompilierung verwalteter Ressourcen ändern,
    	///          das allen RESX-Dateien zugewiesen ist, von denen diese Klasse abhängt.
    	///          Anderenfalls können die Designer nicht korrekt mit den lokalisierten Ressourcen
    	///          arbeiten, die diesem Formular zugewiesen sind.
    	/// </summary>
    	public ref class Form1 : public System::Windows::Forms::Form
    	{
    	public:
    		Form1(void)
    		{
    			InitializeComponent();
    			//
    			//TODO: Konstruktorcode hier hinzufügen.
    			//
    		}
    
    	protected:
    		/// <summary>
    		/// Verwendete Ressourcen bereinigen.
    		/// </summary>
    		~Form1()
    		{
    			if (components)
    			{
    				delete components;
    			}
    		}
    
    	protected: 
    
    	private: System::Windows::Forms::Button^  button1;
    	private: System::Windows::Forms::TextBox^  textBox1;
    	private: System::Windows::Forms::Panel^  panel1;
    
    	private: System::Windows::Forms::GroupBox^  groupBox1;
    	private: System::Windows::Forms::Button^  button2;
    	private: System::Windows::Forms::TextBox^  textBox2;
    	private: System::Windows::Forms::GroupBox^  groupBox2;
    	private: System::Windows::Forms::WebBrowser^  webBrowser1;
    
    	private: System::Windows::Forms::TextBox^  textBox3;
    	private: System::Windows::Forms::DomainUpDown^  domainUpDown1;
    
    	private: System::ComponentModel::IContainer^  components;
    
    	private:
    		/// <summary>
    		/// Erforderliche Designervariable.
    		/// </summary>
    
    #pragma region Windows Form Designer generated code
    		/// <summary>
    		/// Erforderliche Methode für die Designerunterstützung.
    		/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
    		/// </summary>
    		void InitializeComponent(void)
    		{
    			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
    			this->button1 = (gcnew System::Windows::Forms::Button());
    			this->textBox1 = (gcnew System::Windows::Forms::TextBox());
    			this->panel1 = (gcnew System::Windows::Forms::Panel());
    			this->textBox3 = (gcnew System::Windows::Forms::TextBox());
    			this->webBrowser1 = (gcnew System::Windows::Forms::WebBrowser());
    			this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
    			this->button2 = (gcnew System::Windows::Forms::Button());
    			this->textBox2 = (gcnew System::Windows::Forms::TextBox());
    			this->groupBox2 = (gcnew System::Windows::Forms::GroupBox());
    			this->domainUpDown1 = (gcnew System::Windows::Forms::DomainUpDown());
    			this->panel1->SuspendLayout();
    			this->groupBox1->SuspendLayout();
    			this->groupBox2->SuspendLayout();
    			this->SuspendLayout();
    			// 
    			// button1
    			// 
    			this->button1->Location = System::Drawing::Point(10, 45);
    			this->button1->Name = L"button1";
    			this->button1->Size = System::Drawing::Size(75, 23);
    			this->button1->TabIndex = 0;
    			this->button1->Text = L"Suchen";
    			this->button1->UseVisualStyleBackColor = true;
    			this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
    			// 
    			// textBox1
    			// 
    			this->textBox1->Location = System::Drawing::Point(10, 19);
    			this->textBox1->Name = L"textBox1";
    			this->textBox1->Size = System::Drawing::Size(100, 20);
    			this->textBox1->TabIndex = 1;
    			this->textBox1->TextChanged += gcnew System::EventHandler(this, &Form1::textBox1_TextChanged);
    			this->textBox1->Enter += gcnew System::EventHandler(this, &Form1::textBox1_Enter);
    			// 
    			// panel1
    			// 
    			this->panel1->Controls->Add(this->textBox3);
    			this->panel1->Controls->Add(this->webBrowser1);
    			this->panel1->Location = System::Drawing::Point(128, 12);
    			this->panel1->Name = L"panel1";
    			this->panel1->Size = System::Drawing::Size(1044, 743);
    			this->panel1->TabIndex = 2;
    			// 
    			// textBox3
    			// 
    			this->textBox3->Location = System::Drawing::Point(3, 3);
    			this->textBox3->Name = L"textBox3";
    			this->textBox3->Size = System::Drawing::Size(815, 20);
    			this->textBox3->TabIndex = 9;
    			this->textBox3->TextChanged += gcnew System::EventHandler(this, &Form1::textBox3_TextChanged);
    			// 
    			// webBrowser1
    			// 
    			this->webBrowser1->Location = System::Drawing::Point(3, 25);
    			this->webBrowser1->MinimumSize = System::Drawing::Size(20, 20);
    			this->webBrowser1->Name = L"webBrowser1";
    			this->webBrowser1->Size = System::Drawing::Size(1041, 718);
    			this->webBrowser1->TabIndex = 0;
    			this->webBrowser1->Url = (gcnew System::Uri(L"http://news.de", System::UriKind::Absolute));
    			// 
    			// groupBox1
    			// 
    			this->groupBox1->BackgroundImage = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"groupBox1.BackgroundImage")));
    			this->groupBox1->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Zoom;
    			this->groupBox1->Controls->Add(this->textBox1);
    			this->groupBox1->Controls->Add(this->button1);
    			this->groupBox1->Location = System::Drawing::Point(2, 79);
    			this->groupBox1->Name = L"groupBox1";
    			this->groupBox1->Size = System::Drawing::Size(120, 108);
    			this->groupBox1->TabIndex = 3;
    			this->groupBox1->TabStop = false;
    			this->groupBox1->Text = L"Wikipedia Suche";
    			// 
    			// button2
    			// 
    			this->button2->Location = System::Drawing::Point(10, 45);
    			this->button2->Name = L"button2";
    			this->button2->Size = System::Drawing::Size(75, 23);
    			this->button2->TabIndex = 4;
    			this->button2->Text = L"Suchen";
    			this->button2->UseVisualStyleBackColor = true;
    			this->button2->MouseClick += gcnew System::Windows::Forms::MouseEventHandler(this, &Form1::button2_MouseClick);
    			// 
    			// textBox2
    			// 
    			this->textBox2->Location = System::Drawing::Point(10, 19);
    			this->textBox2->Name = L"textBox2";
    			this->textBox2->Size = System::Drawing::Size(100, 20);
    			this->textBox2->TabIndex = 5;
    			// 
    			// groupBox2
    			// 
    			this->groupBox2->BackgroundImage = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"groupBox2.BackgroundImage")));
    			this->groupBox2->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Zoom;
    			this->groupBox2->Controls->Add(this->textBox2);
    			this->groupBox2->Controls->Add(this->button2);
    			this->groupBox2->Location = System::Drawing::Point(2, 213);
    			this->groupBox2->Name = L"groupBox2";
    			this->groupBox2->Size = System::Drawing::Size(120, 108);
    			this->groupBox2->TabIndex = 6;
    			this->groupBox2->TabStop = false;
    			this->groupBox2->Text = L"Google Suche";
    			// 
    			// domainUpDown1
    			// 
    			this->domainUpDown1->Items->Add(L"Intern");
    			this->domainUpDown1->Items->Add(L"Extern");
    			this->domainUpDown1->Location = System::Drawing::Point(2, 15);
    			this->domainUpDown1->Name = L"domainUpDown1";
    			this->domainUpDown1->Size = System::Drawing::Size(120, 20);
    			this->domainUpDown1->TabIndex = 9;
    			this->domainUpDown1->Text = L"Intern/Extern";
    			// 
    			// Form1
    			// 
    			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
    			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
    			this->ClientSize = System::Drawing::Size(1202, 815);
    			this->Controls->Add(this->domainUpDown1);
    			this->Controls->Add(this->groupBox2);
    			this->Controls->Add(this->groupBox1);
    			this->Controls->Add(this->panel1);
    			this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
    			this->Name = L"Form1";
    			this->Text = L"QuickSearch";
    			this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
    			this->panel1->ResumeLayout(false);
    			this->panel1->PerformLayout();
    			this->groupBox1->ResumeLayout(false);
    			this->groupBox1->PerformLayout();
    			this->groupBox2->ResumeLayout(false);
    			this->groupBox2->PerformLayout();
    			this->ResumeLayout(false);
    
    		}
    #pragma endregion
    	private: System::Void groupBox1_Enter(System::Object^  sender, System::EventArgs^  e) {
    			 }
    
    private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
    
    			 if ()
    			 String^ wiki = "http://de.wikipedia.org/wiki/"+this->textBox1->Text;  
    			webBrowser1->Navigate(wiki);
    			 }
    	private: System::Void textBox1_TextChanged(System::Object^  sender, System::EventArgs^  e) {
    			 }
    	private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
    			 }
    private: System::Void button2_MouseClick(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e) {
    			 String^ google = "http://www.google.de/search?hl=de&source=hp&q="+this->textBox2->Text;  
    			webBrowser1->Navigate(google);
    		 }
    private: System::Void webBrowser1_DocumentCompleted(System::Object^  sender, System::Windows::Forms::WebBrowserDocumentCompletedEventArgs^  e) {
    		 }
    
    private: System::Void textBox1_Enter(System::Object^  sender, System::EventArgs^  e) {
    
    		 }
    
    private: System::Void comboBox1_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
    
    		 }
    private: System::Void textBox3_TextChanged(System::Object^  sender, System::EventArgs^  e) {
    		 }
    };
    }
    


  • Huhu, habs jetzt Idee gahbt es mit CheckBox zu lösen...

    Doch siehe da:

    private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {	
    			 if (Form1::checkBox1->Checked = true)
    			 {cout<<"hallo!"<<endl;}
    

    Fehlertext:

    1>------ Erstellen gestartet: Projekt: Website, Konfiguration: Release Win32 ------
    1>Kompilieren...
    1>Website.cpp
    1>c:\users\sebastian\documents\visual studio 2008\projects\website\website\Form1.h(255) : error C2061: Syntaxfehler: Bezeichner 'button1_Click'
    1>c:\users\sebastian\documents\visual studio 2008\projects\website\website\Form1.h(255) : error C2143: Syntaxfehler: Es fehlt ')' vor '{'
    1>c:\users\sebastian\documents\visual studio 2008\projects\website\website\Form1.h(125) : error C2039: 'button1_Click': Ist kein Element von 'Website::Form1'
    1>        c:\users\sebastian\documents\visual studio 2008\projects\website\website\Form1.h(31): Siehe Deklaration von 'Website::Form1'
    1>c:\users\sebastian\documents\visual studio 2008\projects\website\website\Form1.h(125) : error C2065: 'button1_Click': nichtdeklarierter Bezeichner
    1>c:\users\sebastian\documents\visual studio 2008\projects\website\website\Form1.h(125) : error C3350: "System::EventHandler": Ein Delegatkonstruktor erwartet 2 Argument(e).
    1>c:\users\sebastian\documents\visual studio 2008\projects\website\website\Form1.h(256) : error C2451: Bedingter Ausdruck des Typs 'void' nicht zulässig
    1>        Ausdruck vom Typ void kann nicht in andere Typen konvertiert werden
    1>Das Buildprotokoll wurde unter "file://c:\Users\Sebastian\Documents\Visual Studio 2008\Projects\Website\Website\Release\BuildLog.htm" gespeichert.
    1>Website - 6 Fehler, 0 Warnung(en)
    ========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========
    


  • 1. Es fehlt eine schliessende Klammer bei button1_Click
    2. Ein Vergleich wird mit == gemacht. Ein = ist eine Zuweisung, auch in einem if Statement.



  • 🙂

    1. Wusst ich, da befehl noch nicht zuenden
    2. Danke 🙂 Das wars 🙂

    Edit: Wie heißt bei den Textboxen den das Ereigniss wenn man Enter drückt? Ich kennd ie Methode KeyUp e.KeyCode Execute oder so in der Art... Wenn jemand orgen mal Zeit und Lust hat kann er mir das mal erklären, oder sollt ich so langsam mal einen neuen Fred öffnen? 😉



  • Edit:

    So mein projekt ist ja etwas größer,a lso von daher kann es sein dass ihr hier noch oft von mir zu lesen bekommt 😃

    Also:

    Ich möchte jetzt, dass all das, was jetzt zu sehen ist wenn man das Programm ausführt, nur ein TAB ist. Also wie bei einem Browser, auswählbar. Also alles in ein ToolstripMenüItem
    oder wie das heißt.

    Aber wie krieg ich den ganzen Klimbim da rein? Und von wo bis wo muss ich den text dareinschieben, wenn überhaupt?!

    Edit:

    Also ich habe

    // 
    			// toolStripMenuItem1
    			// 
    			this->toolStripMenuItem1->Name = L"toolStripMenuItem1";
    			this->toolStripMenuItem1->Size = System::Drawing::Size(51, 20);
    			this->toolStripMenuItem1->Text = L"Suche";
    

    Und will den ganzen Klimbim nur Sehen können wenn ich dieses Item anklicke. Sonst andere Seiten...



  • Malarkey. schrieb:

    Aber wie krieg ich den ganzen Klimbim da rein? Und von wo bis wo muss ich den text dareinschieben, wenn überhaupt?!

    Alter Schwede lies bitte mal ein Grundlagenbuch.



  • InComing.

    Müsste morgen ankommen...


Anmelden zum Antworten