Unity3d Input field text cut off when getting from script? - c#

When sample#email.com is entered into the input field, I am able to get the value "sample#email.com" from MonoDevelop.
However, when extrawordsample#email.com is entered into the input field, I am only able to get the value "wordsample#email.com". In this case, the characters "extra" seem to be cut off when I get the input field value from MonoDevelop. It also appears that any text in the text field that exceeds the visible area will be cut off.
Does anyone know how do I resolve this issue?

It seems that i should have took the text from the input field component but instead i was talking the text from the where it is displaying.
Now i am able to correctly retrieve the text.
found the answer on unity,
Input Field
Hints
To obtains the text of the Input Field, use the text property on the InputField component itself, not the text property of the Text component that displays the text. The text property of the Text component may be cropped or may consist of asterisks for passwords.

In inspector of İnputField, there is a script component named "İnput Field" and there is "Character Limit" variable. Change it to 25 for extrawordsample#email.com or more.

Related

how to show **** in textbox though it contains other text, in c#.net?

i have a grid view with two fields id & password. i have added the update query where the password gets updated according to the id. but the problem is that to update the password , it must be shown in the grid view password field. so is there a way where i can show * instead of the actual text in that password field?
i just want to show stars instead of the actual paswrd in this gridview...is this possible? i have tried converting the field into a template and changing its display text ut that doesnt work...
i m doing this in .net webforms..
On the assumption that you're using WPF, you want the PasswordBox class; don't try and reinvent the wheel. Strictly that will display bullets rather than stars, but as that's what every other password field does in Windows, I'd suggest that's what you want to be doing.
(It is actually possible to change the character displayed by setting the PasswordChar property, but I still don't think you should be changing it to a star unless you've got a really good reason).
Add type="password" to your password input field.

SpellCheck Functionality in Textbox

I have an issue in Spellchecking the text that is entered in a textbox in wpf 3.5
<TextBox Name="tbxBack" SpellCheck.IsEnabled="True"/>
It will Check fine for the wrongly spell words in the sentence that I have entered in the text box, but when I right click on the wrongly spell word and try to make correct, it is only making the first word correct in the sentence.
for example:
the sentence is:
tey are plaing in playgroun (They are playing in playground)
when I right click on "tey", system is giving the appropriate results and setting the correct value ("They" for "tey"),
but when I right click on "plaing", system gives the correct values, but does not set it to correctvalue ("playing").
same for "playgroun" (doesn't set to playground), System is checking only the first word.
How to make it work for the whole sentence?

RichTextBox invisible selectable character at end of string

When selecting text in a RichTextBox using the mouse, or arrow keys + shift, I can select an extra blank character at the end of the string. To reproduce:
type a few characters (or nothing at all) in a RichTextBox
set the cursor to the end of the string
hold shift and press the right arrow key
You'll see a narrow highlighted selection appear, which cannot be deleted.
This causes a problem in my application because the SelectionFont property returns null when the extra character is selected along with some valid text. Any ideas on how to disable this extra character, or work around it otherwise?
c# winforms, visual studio 2010
Interesting. (This is not Dr House, MD, speaking.)
When nothing is selected in an empty RTF edit control, SelectedRtf returns:
"{\rtf1\ansi\ansicpg1252\deff0\deflang2055\uc1 }"
When the "phantom" stuff is selected in the empty RTF edit control, SelectedRtf returns:
"{\rtf1\ansi\ansicpg1252\deff0\deflang2055{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
\viewkind4\uc1\pard\f0\fs17\par
}"
Of course, SelectedText returns the empty string in both cases.
So I suspect what is selected is the metainfo that makes sure that newly entered text that would replace the empty selection will be inserted with the correct font.
However, that seems to be nonsense since newly entered text will be inserted with the correct font even if nothing is selected.
So all that does not make sense. (Well, it does, kind of -- see last paragraph)
Which makes me believe this is a bug, or at least a glitch, in RichTextBox.
The formatting info is probably created by the selection routine which makes sure that selected non-empty text will be replaced by the newly typed text formatted in the same format as the text it replaces. For this to work, a selection must always contain the formatting info, even if no text is selected. I think. Maybe one can pre-select a char and paragraph formatting different from the default one, somehow, and then typing text uses that format.
FIred up a new winforms app in studio 2010 and wasn't really able to reproduce this. I can select the invisible 'character' but it doesn't cause me any problems. SelectedFont still returns a valid object for me. I can get the text without issue.
The SelectionFont property for the RichTextBox control can ONLY return a single font. If the selected range contains more than one font, reading the SelectionFont property will throw a NullReferenceException.
Most likely what is happening is that the RichTextBox Font property is different than the current font you are using on the selected range. That "extra" character selected at the end is your Font property, not your SelectionFont property.
If your RichTextBox is just using a single font, just make sure the Font and SelectionFont property are the same.
Otherwise, just check if it's null:
if (richTextBox1.SelectionFont != null) {
//do something
}

Can I insert text into the console input buffer?

To start off, I don't even know if I used the proper terminology. What I'm talking about is let's say I have a program that displays the value of a string and it also allows me to edit the value. What I want to do is when I begin to edit the value, the original value will be placed in my input so it'll be as if I manually typed in the original value and am able to use backspace and stuff.
It's like I just changed the value to a very long sentence and I realized I misspelled one word so when I edit the value the original pops up so I can use the arrow keys to move to the word and fix it, instead of having to retype the entire sentence.
I think you want to use a C# wrapper for the curses terminal control library.

Suggestions on interface design

I need to design a kind of templating system for text: the user enters a piece of text and types some special markers like (**) inside the text that tell the software that the text (**) will need to be changed to some other content.
What I would like to do, is displaying the user the list of fields that need to be changes so that the user can insert the proper data.
I was thinking about doing that displaying all the text (in a text box) and substitute the (**) chars with a textbox so that the user can enter the text. Is there a way to do that? What do you think of this approach? Do you have better ideas? The point is that I would like to show the user the context in which the substitution takes place.
Thanks.
Why not scan the text and generate textboxes on the fly?
Your code would display the templated text, scan it and then, per templated variable it finds, generate 1 textbox. You list those textboxes, one per line, below the text and as soon as the contents in one textbox change, you update the text so that the user sees what this will look like.

Categories

Resources