PDA

View Full Version : مبتدی: مشکل با کد VB



hadi46
چهارشنبه 16 آذر 1390, 11:46 صبح
با سلام خدمت تمام دوستان گرامی
من در تبدیل این کد به VB مشکل دارم
این کد C#‎
void changeEvaent(Control c, Type changeType, EventHandler handler)

{
foreach (Control cc in c.Controls)
if (cc.GetType() == changeType)
cc.TextChanged += new EventHandler(handler);
else
changeEvaent(cc, changeType, handler);
}

بعد از تبدیل به VB و مقایسه و HANDLER ش مشکل دارم اگه می تونید کمک کنید


Private Sub changeEvaent(ByVal c As Control, ByVal changeType As Type, ByVal handler As EventHandler)
For Each cc As Control In c.Controls
If (cc.GetType = changeType) Then
AddHandler cc.TextChanged, AddressOf Me.handler
Else
changeEvaent(cc, changeType, handler)
End If
Next
End Sub

mgh64120
چهارشنبه 16 آذر 1390, 14:59 عصر
سلام دوست عزيز
تبديل شده كدتون به VB.Net

Private Sub changeEvaent(c As Control, changeType As Type, handler As EventHandler)
For Each cc As Control In c.Controls
If cc.[GetType]() = changeType Then
cc.TextChanged += New EventHandler(handler)
Else
changeEvaent(cc, changeType, handler)
End If
Next
End Sub

موفق باشيد.