Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 How to assign text to a textbox in c++ ?

views
     
TSAthono
post Apr 25 2015, 03:00 AM, updated 9y ago

Getting Started
**
Junior Member
227 posts

Joined: Dec 2005
I have a silverlight app that uses TextBox XAML controls.

In the c++ code-behind, IXRTextBoxPtr types are associated with these textboxes using "FindName" like this:

FindName(L"ColNum3", &m_pColNum3);

(where ColNum3 corresponds with the XAML CODE like this: )

Then, the code assigns the pointer like this:

std::wstring wsTransfer; // gets the wstring from imput
const WCHAR * wpszInput;
wpszInput = wsTransfer.c_str();
m_pColNum3->SetText(wpszInput);
but the display does not show the text data.

What am I missing? What steps am I missing to have this text modification display on the screen?
Eulm585
post Apr 25 2015, 03:42 AM

Enthusiast
*****
Junior Member
818 posts

Joined: Jan 2015


can you tell what errors you are getting?




edit: if you are using C++/CLI which is NOT C++. you might need to convert string into System::String^



https://msdn.microsoft.com/en-us/library/bb384859.aspx
https://msdn.microsoft.com/en-us/library/bb384865.aspx

This post has been edited by Eulm585: Apr 25 2015, 03:58 AM

 

Change to:
| Lo-Fi Version
0.0118sec    0.57    5 queries    GZIP Disabled
Time is now: 29th March 2024 - 03:00 PM