DvLrepLay Posted March 15, 2012 Report Posted March 15, 2012 Salut , vreau sa fac o aplicatie in visual basic dar am o problema , daca userul apasa pe butonul x , executa ce am trecut eu in elde ex am Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Len(dns.Text) = 0 Then MsgBox("Dns-ul nu a fost ales") End If......aici ce sa execute.....cum pot face daca if Len(dns.Text) = 0 sa arate msgbox , dar sa nu mearga mai departe Quote
nedo Posted March 15, 2012 Report Posted March 15, 2012 Incearca sa pui in paranteza len(dns.Text) = 0 Quote
DvLrepLay Posted March 15, 2012 Author Report Posted March 15, 2012 degeaba , tot trece mai departe Quote
iBebe Posted March 15, 2012 Report Posted March 15, 2012 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Len(dns.Text) = 0 Then Return False MsgBox ("Dns-ul nu a fost ales") Else Return True End If End SubIncearca asa. Quote
DvLrepLay Posted March 15, 2012 Author Report Posted March 15, 2012 'Return' statement in a Sub or a Set cannot return a value. Quote
DrGrim Posted March 15, 2012 Report Posted March 15, 2012 (edited) If Len(dns.Text) = 0 Then MsgBox (" Dns-ul nu a fost ales ") else MsgBox (dns.text) /sau ce altceva doresti sa faca End Ifsau poti incerca :If Len(dns.Text) > 0 Then MsgBox (dns.text) /ce doresti sa faca daca numarul caracterelor este mai mare decat 0 End IfSunt la fel amandoua ,sa imi zici daca iti merge Edited March 15, 2012 by DrGrim Quote