| | |
I cant find what is wrong in this code
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Feb 2008
Posts: 517
Reputation:
Solved Threads: 1
I use this code in a multilined textBox event handler. When writing:
"hellowalker" in the textBox:s first line, "walker" turns blue.
If you delete this and go down a line and write the same: "owalker" turns blue and down a line again "lowalker" turns blue.
What could be wrong with this code as I always want the word "walker" to turn blue.
"hellowalker" in the textBox:s first line, "walker" turns blue.
If you delete this and go down a line and write the same: "owalker" turns blue and down a line again "lowalker" turns blue.
What could be wrong with this code as I always want the word "walker" to turn blue.
C++ Syntax (Toggle Plain Text)
string stringToFind1 = "walke"; int positionen = 0; positionen = textBox1->SelectionStart; if (textBox1->Text != "") { array<System::String^>^ ReadLines = gcnew array<System::String^> ( textBox1->Lines->Length ); ReadLines = textBox1->Lines; std::string Line1; std::string Line2; for(int count = 0; count < textBox1->Lines->Length; count++) { MarshalString(ReadLines[count], Line1); Line2 = Line1.c_str(); std::transform(Line2.begin(), Line2.end(), Line2.begin(), ::tolower); std::string::size_type startPos = Line2.find(stringToFind1); if ( startPos != std::string::npos ) { startPos += stringToFind1.length(); std::string::size_type endPos = Line2.find("r", startPos); if ( endPos != std::string::npos )
Last edited by Ancient Dragon; Mar 19th, 2008 at 9:56 pm. Reason: corrected code tags
![]() |
Similar Threads
- code executes...but doesnt update the database (Java)
- Can anybody tell what's wrong with this code? (C++)
- wuts wrong with my code here? (C++)
- HELP (Recursion/Arrays) (Java)
- I am trying to get this code to work. Please help. (C++)
- error C2447: missing function header (old-style formal list?), what does this mean?! (C++)
- Insertion in a binary search tree (C++)
- how can i find out some char from string? (C++)
- redefinition error please help (C++)
- Noob help! (C++)
Other Threads in the C++ Forum
- Previous Thread: Arrays[]
- Next Thread: Random Number not working
Views: 400 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll encryption error file forms fstream function functions game getline givemetehcodez google graph homeworkhelper iamthwee ifstream input int integer java lazy lib linkedlist linux loop looping loops map math matrix memory microsoft newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort string strings struct studio system template templates test text tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






