Can some1 give me maximum of validation on....

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2007
Posts: 72
Reputation: geetajlo is an unknown quantity at this point 
Solved Threads: 0
geetajlo geetajlo is offline Offline
Junior Poster in Training

Can some1 give me maximum of validation on....

 
0
  #1
Mar 6th, 2008
Hi ...
Can u plzz help me ..
i want to put maximum validation for each control on my form..
it contain a textbox(input only alphabets), a combo box(display only Mr,Mrs, Miss), a datagrid..
and also how do i put a tool tip text on a textbox..

Note for the combo box i have already bind it but it displays all 5 Mr 2 Mrs and Miss
i just want it to be unique i.e Mr Mrs Miss

Need Help plzzzzzzz
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: Can some1 give me maximum of validation on....

 
0
  #2
Mar 7th, 2008
About ComboBox you can control the data it bound to be unique i.e if you return data from database let it distinct

About tooltip, its show method take the control it shows if the cursor came on and the string it displayes i.e ToolTip1.Show(textbox1, "this is textbox")

About a textbox(input only alphabets) in text changed handler for the textbx\richtextbox it receives the key (last one) written on the textbox\richtextbox using some Char\char class method you can check if the key written was alphabet or digits and take the decision
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Can some1 give me maximum of validation on....

 
0
  #3
Mar 7th, 2008
This following code to input string only, other character wont allowed to input.
  1. Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
  2. If (Microsoft.VisualBasic.Asc(e.KeyChar) < 65) _
  3. Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 90) _
  4. And (Microsoft.VisualBasic.Asc(e.KeyChar) < 97) _
  5. Or (Microsoft.VisualBasic.Asc(e.KeyChar) > 122) Then
  6. 'space accepted
  7. If (Microsoft.VisualBasic.Asc(e.KeyChar) <> 32) Then
  8. e.Handled = True
  9. End If
  10. End If
  11. If (Microsoft.VisualBasic.Asc(e.KeyChar) = 8) _
  12. Or (Microsoft.VisualBasic.Asc(e.KeyChar) = 44) _
  13. Or (Microsoft.VisualBasic.Asc(e.KeyChar) = 45) _
  14. Or (Microsoft.VisualBasic.Asc(e.KeyChar) = 46) Then
  15. e.Handled = False
  16. End If
  17. End Sub

Tooltips :
drag tooltips control to your destination form then all of control has tooltips editor in their properties control. you can add text in tooltips properties (use like in vb 6).
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the VB.NET Forum
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC