منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : تصحيح مشكلة في المشروع
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
السلام عليكم ورحمة االله

حصلت مشروع وحاولت اضبطه في تعبني في مشكله

المشروع عباره عن فورم رئيسي ويعرض في عدة فورمات والتحويل بينهم بزر Next  و Previous
[attachment=15765]

عند الضغط على زر التالي يطلع لي مشكله
إقتباس :Additional information: Conversion from string "" to type 'Integer' is not valid.

[attachment=15766]

كود :
      Dim nCurrent As Integer = CType(cCurrent.Replace("Form", ""), Integer)


       nCurrent += 1
       If nCurrent > nMax Then
           nCurrent = 1
       End If


اتمنى احصل حل لهذه المشكله  بارك الله فيكم وشكرا

[attachment=15767]
PHP كود :
Public Class frmMain

    Dim forms
() As Form = {Form1Form2Form3Form4Form5}
 
   Dim cCurrent As Integer 0

    Private Sub frmMain_Load
(ByVal sender As ObjectByVal e As EventArgsHandles MyBase.Load
        Panel1
.Width Me.Width
        getForm
(cCurrent)
 
   End Sub


    Private Sub Button1_Click
(ByVal sender As ObjectByVal e As EventArgsHandles Button1.Click
        MovePrevious
()
 
   End Sub

    Private Sub Button2_Click
(ByVal sender As ObjectByVal e As EventArgsHandles Button2.Click
        MoveNext
()
 
   End Sub

    Private Sub MovePrevious
()
 
       If cCurrent 0 Then
            cCurrent 
-= 1
            getForm
(cCurrent)
 
       End If
 
   End Sub

    Private Sub MoveNext
()
 
       If cCurrent forms.Count 1 Then
            cCurrent 
+= 1
            getForm
(cCurrent)
 
       End If
 
   End Sub

    Sub getForm
(ByVal index)
 
       Panel1.Controls.Clear()
 
       forms(index).FormBorderStyle Windows.Forms.FormBorderStyle.None
        forms
(index).Dock DockStyle.Fill
        forms
(index).TopLevel False
        forms
(index).Show()
 
       Panel1.Controls.Add(forms(index))
 
   End Sub

End 
Class 
(17-10-17, 12:30 PM)a.ahmed كتب : [ -> ]
PHP كود :
Public Class frmMain

    Dim forms
() As Form = {Form1Form2Form3Form4Form5}
 
   Dim cCurrent As Integer 0

    Private Sub frmMain_Load
(ByVal sender As ObjectByVal e As EventArgsHandles MyBase.Load
        Panel1
.Width Me.Width
        getForm
(cCurrent)
 
   End Sub


    Private Sub Button1_Click
(ByVal sender As ObjectByVal e As EventArgsHandles Button1.Click
        MovePrevious
()
 
   End Sub

    Private Sub Button2_Click
(ByVal sender As ObjectByVal e As EventArgsHandles Button2.Click
        MoveNext
()
 
   End Sub

    Private Sub MovePrevious
()
 
       If cCurrent 0 Then
            cCurrent 
-= 1
            getForm
(cCurrent)
 
       End If
 
   End Sub

    Private Sub MoveNext
()
 
       If cCurrent forms.Count 1 Then
            cCurrent 
+= 1
            getForm
(cCurrent)
 
       End If
 
   End Sub

    Sub getForm
(ByVal index)
 
       Panel1.Controls.Clear()
 
       forms(index).FormBorderStyle Windows.Forms.FormBorderStyle.None
        forms
(index).Dock DockStyle.Fill
        forms
(index).TopLevel False
        forms
(index).Show()
 
       Panel1.Controls.Add(forms(index))
 
   End Sub

End 
Class 

ما شاءالله تبارك الله

كالعادة مبدع الله يبارك فيك وجزاك خيرا 

الكود شغال تمام بس طلع لي مشكله في 

كود :
   Sub getForm(ByVal index)
       Panel1.Controls.Clear()
       forms(index).FormBorderStyle = Windows.Forms.FormBorderStyle.None
       forms(index).Dock = DockStyle.Fill
       forms(index).TopLevel = False
       forms(index).Show()
       Panel1.Controls.Add(forms(index))


هنا

كود :
 forms(index).FormBorderStyle = Windows.Forms.FormBorderStyle.None


وعندما مسحت هذا الكود 
كود :
 forms(index).FormBorderStyle = Windows.Forms.FormBorderStyle.None


اشتغل تمام 


شكراااااا Rolleyes