Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
N

newkid

@newkid
About
Posts
8
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Runs Commands in order
    N newkid

    Hi, I'm using Windows Forms C++. I'm getting the user to add commands to a listbox then they click on a button and this runs the commands in the listbox. The problem I have is, I don't know how to run these commands from an index number because they are currently being run in the order shown below and not in the order of where they are in the listbox. Does anyone have any ideas? do { if(lstCommands->Items->Count > 0) { if(lstCommands->Items->Contains("Move forward")) { protocol_test(2, distance, 0); } else if(lstCommands->Items->Contains("Move Back")) { protocol_test(3, distance, 0); } else if(lstCommands->Items->Contains("Turn Right")) { protocol_test(4, distance, degrees); lstCommands->Items->Remove("Turn Right"); } else if(lstCommands->Items->Contains("Turn Left")) { protocol_test(5, distance, degrees); } } else if(lstCommands->Text->Empty) { MessageBox::Show("No Commands selected","No Commands",MessageBoxButtons::OKCancel,MessageBoxIcon::Exclamation); } } while(!lstCommands->Items->Count == 0);

    Managed C++/CLI c++ database winforms help tutorial

  • Reading a File
    N newkid

    Hi I was wondering to read a file in and display this file in a listbox. I know how to do this in the console programming but not sure how to do this in windows forms. This how I do it in console programming. Just not sure how to do this in windows forms. int openFile() { ifstream filex; filex.open ("test.txt", ios::in ); if (filex.is_open()) { filex.seekg (0, ios::end); size = filex.tellg(); filemem = new char [size]; filex.seekg (0, ios::beg); filex.read (filemem, size); ifstream fin("test.txt",ios ::in); cout << cin.rdbuf(); filex.close(); } else { cout << "Unable to open file"; } return 0; } Thanks The New kid

    Managed C++/CLI ios winforms tutorial

  • Add/Remove items in a listBox
    N newkid

    Thanks thats sovled the problem

    Managed C++/CLI winforms tutorial

  • Add/Remove items in a listBox
    N newkid

    so i create a string say x, how do you set an item in the comboBox to x? string x; this->cmbCommands->Select(); cmbCommands->SelectedItem; this->lstCommands->Items->Add("x");

    Managed C++/CLI winforms tutorial

  • Add/Remove items in a listBox
    N newkid

    Hi, i'm using windows forms and I was wondering how to add to a listBox from a comboBox. Also how to remove an item from the listBox. private: System::Void btnConfirmCommand_Click(System::Object^ sender, System::EventArgs^ e) { this->cmbCommands->Select(); this->lstCommands->Items->Add(cmbCommands); } private: System::Void btnRemoveCommand_Click(System::Object^ sender, System::EventArgs^ e) { this->lstCommands->Select(); this->lstCommands->Items->Remove(lstCommands); }

    modified on Thursday, January 31, 2008 10:27:48 AM

    Managed C++/CLI winforms tutorial

  • Method Call problem
    N newkid

    The problem I’m having is when the user selects a menu item it should execute code in protocol_test.cpp In Windows Forms the code for the interface is written in a header file “frmIndex.h” //In frmIndex.h (The windows Form form) private: System::Void pANGUToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) { //Finding it difficult to call the method from the protocol_test.cpp pangu_server(); //I have also tried int *pan; class protocol_test; pan::pangu_server(); } The protocol_test.cpp was part of a console program which connects to server. This class had a main in it but I renamed this to int pangu_server(). The protocol_test.cpp does not have a header file but when I create a header file for it I still can the same error. Even I have even created a simply class and header that would just write to the console which doesn’t work.

    Managed C++/CLI help c++ winforms sysadmin

  • Calling a function issue
    N newkid

    Hey i'm new to visual C++ and i'm using windows forms but that forum doesn't seem to get answered. I'm wondering how to call a method from a class in the form1.h? so for example: form1.h private: System::Void testToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) //Not sure how to call the test method { Class test void test() { //Code here }

    Managed C++/CLI c++ tutorial winforms help question

  • Calling a function
    N newkid

    Hey i'm new to visual C++ and i'm using windows forms but that forum doesn't seem to get answered. I'm wondering how to call a method from a class in the form1.h? so for example: form1.h private: System::Void testToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) //Not sure how to call the test method { Class test void test() { //Code here }

    C / C++ / MFC c++ tutorial winforms question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups