2
Answers

validation

narasiman man

narasiman man

12y
855
1


 i post a question i have one field loan in that i have to type only numbers not characters.

Loan 1000.

you posted answers as follows

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
  {
 
  if (!System.Text.RegularExpressions.Regex.IsMatch(e.KeyChar.ToString(), "\\d+"))

  e.Handled = true;
  }

in that i click  a loan text box

private void txt_loan_TextChanged(object sender, EventArgs e)

only text changed only there.not key press event.


what to do. 

above one i am creating in vb.net using csharp. it is a window application.help me wat to do.

Regards,
Narasiman P


Answers (2)
0
person

person

NA 96 0 15y
Sanjay,

Thanks for the reply it helped significantly!!

Urema.
0
Sanjay Chauhan

Sanjay Chauhan

NA 461 0 15y

 Hi,

<StackPanel  Grid.Row="1" Grid.Column="1" Background="RoyalBlue" Height="400"  ScrollViewer.VerticalScrollBarVisibility="Auto">


           <ItemsControl x:Name="lstPics" ItemsSource="{Binding}" Height="400" SelectionChanged="lstPics_SelectionChanged" ScrollViewer.VerticalScrollBarVisibility="Visible">
                <ItemsControl.ItemTemplate>

                    <DataTemplate>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding Path=FileName}" />
<CheckBox IsChecked="{Binding Path=IsSavedInServer}" Content="exist in server" />
</StackPanel>
<Image Source="{Binding Path=ImageSource}" Height="100" Width="150" Stretch="Fill" />
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl >
</StackPanel>
Put the

ScrollViewer.VerticalScrollBarVisibility="Auto"

For vertical scrollbar. Check the above code.