دى محاولتى و لكن فشلت
و هنا كانت المشكلة
Warning 1 Variable 's' is used before it has been assigned a value. A null reference exception could result at runtime
ايه الحل ياريت لو حد يعرف
كود :
Public Class Alyspicy
Public Sub doit(ByVal NameForm As System.Windows.Forms.Form)
For Each h As System.Windows.Forms.Button In NameForm.Controls
AddHandler h.Click, AddressOf hclick
On Error Resume Next
Next
End Sub
Private Sub hclick(ByVal sender As Object, ByVal e As EventArgs)
MsgBox(sender.text)
End Sub
End Classكود :
Imports Alyspicy
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim s As Alyspicy.Alyspicy
s.doit(Me)
End Sub
End ClassWarning 1 Variable 's' is used before it has been assigned a value. A null reference exception could result at runtime
ايه الحل ياريت لو حد يعرف
قال تعالى : يَامَعْشَرَ الْجِنِّ وَالإِنسِ إِنْ اسْتَطَعْتُمْ أَنْ تَنفُذُوا مِنْ أَقْطَارِ السَّمَاوَاتِ وَالأَرْضِ فَانفُذُوا لا تَنفُذُونَ إِلاّ بِسُلْطَانٍ
