Textbox to string

This is a discussion on Textbox to string within the C++ Programming forums, part of the General Programming Boards category; If I have a RichTextBox that is named "richTextBox1". In this box I will write for ex this word below: ...

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    383

    Textbox to string

    If I have a RichTextBox that is named "richTextBox1".
    In this box I will write for ex this word below:

    OneWord


    How is it possible to assign: OneWord into a stringvariable ?

  2. #2
    The larch
    Join Date
    May 2006
    Posts
    3,573
    Find and RTFM.
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    383
    I am trying to do this but the compiler don´t like it. I wonder If I should write something else here than Text ?

    Code:
    std::string FirstValue;
    			
    FirstValue = string::find(richTextBox2->Text);
    Last edited by Coding; 02-02-2008 at 04:50 PM.

  4. #4
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,412
    wxwidgets?
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  5. #5
    Registered User
    Join Date
    Dec 2007
    Posts
    383
    What is wxwidgets, is this something that could be used for this purpose ?

  6. #6
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,452
    It's a GUI Framework.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #7
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,412
    was asking if that was the library you were using. Nevermind then. I could only help if it was.

    And yes. wxWidgets is a library that provides a framework to develop nearly cross-compatible GUIs.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  8. #8
    Registered User
    Join Date
    Dec 2007
    Posts
    383
    No this might not be what I am using.
    I know it is possible to search a textbox using:

    string::find but from here I really not sure how to assign all of the contents in a textbox into ex:

    std::string FirstValue;

    I tried this but something might be wrong:

    Code:
    std::string FirstValue;
    			
    FirstValue = string::find(richTextBox2->Text);

  9. #9
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,452
    What are you using?
    What is the type of richTextBox2?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  10. #10
    Registered User
    Join Date
    Dec 2007
    Posts
    383
    I am not sure if I understand... what do you meen by type. It is a "RichTextBox" and not a "TextBox" if it was this you ment.

  11. #11
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,452
    The type of the variable a in this example,
    int a
    is int. So what's the type of your richTextBox2 variable?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  12. #12
    Registered User
    Join Date
    Dec 2007
    Posts
    383
    What I am really after to do is this. I dont really know if it is possible or what approch that could be used for this purpose.
    Assume that we have this code:

    Code:
    int Number1 = 0;
    int Number2 = 10;
    int Number3 = 0;
    
    if (Number1 < Number2)
    	{
    		Number3 = 10;
    	}
    This is working fine, we assign Number3 = 10; here.
    Now what I want to do is to interact with this code through a RichTextBox and what I want to write in this box is the statement:
    Code:
    if (Number1 < Number2)
    So instead of write this in the code, I will do this line in the RichTextBox instead.
    Is this possible in any way ?

    Thanks
    Last edited by Coding; 02-02-2008 at 05:47 PM.

  13. #13
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,452
    Yes, you can set text of a textbox, but we need to know what the heck you're using!
    Are you using native Win32? MFC? Some other cross-platform toolkit?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  14. #14
    Registered User
    Join Date
    Dec 2007
    Posts
    383
    I am using VC++ 2008 Express Edition. As it is a statement I dont know if perheps a bool must be used here in any way...
    Last edited by Coding; 02-02-2008 at 05:53 PM.

  15. #15
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,452
    You're not helping here...
    How are you creating your GUI? Are you creating it at all?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OOP Question DB Access Wrapper Classes
    By digioz in forum C# Programming
    Replies: 2
    Last Post: 09-07-2008, 04:30 PM
  2. Replies: 8
    Last Post: 04-25-2008, 02:45 PM
  3. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 10:03 PM
  4. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 02:23 PM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21