Prevent submit empty textbox in Windows 8 Metro Application - c#

is there any control like RequiredFeild control (asp.net) in windows 8 metro? I have a simple form with several text boxes and I just want to make sure to prevent submit it when a textbox is empty. I know it can be easy in code but I'm eager to know are there any alternative ways?

You might want to use WinRT XAML Toolkit:
TextBoxValidationExtensions - extensions that allow to specify the
Format of the requested Text input as well as brushes to use to
highlight a TextBox with valid or invalid Text.
I'm assuming you actually want to validate the input.

this is another solution that I found.
Here

Why you don't use String.IsNullOrEmpty() ?

Related

How to set mode Password for TextBox control wpf without passwordbox?

I need to USE hidden inserted symbols in my textbox and show "password" like "*******".
But after this I will use inserted password for login. I can not use PasswordBox because it don't have need touch event.
How do I do it ?
You should check out this answer to a similar question:
https://stackoverflow.com/a/481097/4192732
You basically need a third-party extension to avoid using the passwordbox, as there are no first-party methods of masking a WPF textbox.

Make a Textbox recognize a url or external link

I would like to know how can i make that a textbox or a richtextbox recognizes a url within a text in windows phone
My textbox is bonded so i don't know what the text will be.
Is there a way to make the textbox recognize the url?
Thank you !
You could try implementing a converter, which does some type of logic based on whatever it is you're trying to accomplish (your question seems a little vague in this sense)
You should look into ValueConverters => http://wpftutorial.net/ValueConverters.html

Textboxes in Asp.Net using C#?

How to get different colors of text in a text box in ASP.NET when words printed in the Text Box are dynamic using database? Please help! There is rich text box for this purpose in Window Form but what about the web forms?
Standard ASP.NET TextBox renders as <input type="text"> which does not support styles for individual characters.
You can use a 3rd party tool or, at a very basic you can use DIV with contenteditable set to true:
Here's a small demo: http://jsfiddle.net/Pr9mm/
If you are looking for a rich-text box to use - try the HTMLEditor in the AjaxControlToolkit. It is essentially the same functionality. Just make sure to put a sanitizer on it to avoid XSS problems.
Check the accepted answer for this question. Eventhough it is for gridview the same logic could be used for textbox also. Hope this helps you in right direction.
Consider using the HtmlEditorExtender from the ajax control toolkit. You can also configure how the textbox looks.

Custom MessageBox in C#

I am making a custom MessageBox in my own language (Persian). I want to know which component may I use for the text?
Label is not multiline and TextBox is a little bit not appropriate.
Which component does Visual Studio use itself?
What is the component I specified in the picture?
You can use a label. It has a number of options for laying out the text... One way is to set it to "AutoSize = True".
I support the answer of RQDQ, labels could be enlarged to occupy more than one line.
They have a property named TextAlign. When set to LeftCenter or MiddleCenter you could simulate the behavior of text in a message box. If the text doesn't fit in a single line, the label wraps it automatically on another line. However in this case I will let the property AutoSize to its false default value.
It all depends on what kind of Visual Studio project you are doing. Wpf or Silverlight or Asp.net or even windows, everything will depend upon which kind of project it is.
That looks to me like the MFC style label with an image, or in a browser it would be done with javascript.
You Can Use RichTextBox. I Use it For My Custom MessageBox And it works Correctlly

TextBox Label Control

I am not worried about whether this is in Winforms or WPF.
Is there ANY way at all that I could develop my own user control like the one found in Microsoft Paint, below:
If you can't see the pic above, it's here: http://img232.imageshack.us/i/txtboxlblctrl.png/
Is there anyway at all I can do something like this in C#?
Thank you
Sure you can. By developing your own Usercontrol you can do nearly anything.
I think the easiest way would be to use a WPF TextBox and alternate it with a template.
This [http://img199.imageshack.us/i/textboxu.png/] is what you get by simply using [http://img163.imageshack.us/i/stipe.png/] as BorderBrush

Categories