Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Button click validate Textboxes

$
0
0

Hi Guys, need you ideas. It may be simple but i need your help.

I got 3 text boxes, the first 2 to enter some texts & the third to get the selected value(image) from browse dialog image.

I got a button, when i click on the button I want to validate the user must have entered a value in any one of the first 2 text-boxes and in the third text box value is must.

I tried doing it with ìf`loop but something is not clear. Please give me some idea & i'll do it. Thank you.

private void visuCtemplateImage_Click(object sender, RoutedEventArgs e)
{

if(thtmlline1.Text.Length <= 0 || thtmlline2.Text.Length <= 0 && timageName.Text.Length <= 0) { MessageBox.Show("Enter any one of the text box & one image value in third text box"); return; }

}

Thank you.




Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>