Results 1 to 11 of 11

Thread: New open and save problem [Resolved]

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Location
    Can't say sorry :)
    Posts
    79

    New open and save problem [Resolved]

    For a very weird reason, I can't save, nor open. It won't let me specify what to open and pops up a error whenever I try to.
    This is my main program. It won't load or save.
    VB Code:
    1. Option Strict On
    2. Option Explicit On
    3. Public Class Chaoseditor
    4.     Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
    5.         Dim theButton As Long
    6.         theButton = MsgBox("Do you wish to exit?", MsgBoxStyle.YesNo)
    7.         If theButton = vbYes Then
    8.             End
    9.         Else
    10.  
    11.         End If
    12.     End Sub
    13.  
    14.     Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
    15.         Opn.Filter = "GDP Game Developement Project (*.gdp)|*.gdp|All files (*.*)|*.*" ' Open Game Dev Project (No workie)
    16.         Opn.FilterIndex = 1
    17.         Opn.ShowDialog()
    18.     End Sub
    19.  
    20.     Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveAsToolStripMenuItem.Click
    21.         Dim SV As SaveFileDialog
    22.         SV.Filter = "GDP Game Developement Project (*.gdp)|*.gdp*" ' save as Game Dev Project (no workie)
    23.         Sv.FilterIndex = 1
    24.         SV.ShowDialog()
    25.  
    26.     End Sub
    27.  
    28.     Private Sub NewToolStripMenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripMenuItem4.Click
    29.         CCE.Show() ' Show Chaos Code editor
    30.     End Sub
    31. End Class

    This one pops up a error when I press Open, and then cancel. It points to the commented command when I do.
    VB Code:
    1. Public Class CCE
    2.  
    3.     Private Sub FileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FileToolStripMenuItem.Click
    4.  
    5.     End Sub
    6.  
    7.     Private Sub CompileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CompileToolStripMenuItem.Click
    8.  
    9.     End Sub
    10.  
    11.     Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripMenuItem.Click
    12.         Dim dlg1 As New CCE
    13.         dlg1.ShowDialog() ' Pressed new show's new form
    14.  
    15.     End Sub
    16.     Function Color(ByVal source As String) As Double
    17.         'If Replace(source, " ", "") Then End ' If source "" or " " then end it
    18.         Dim rtb As RichTextBox ' name rtb as a RichText Box type
    19.         ' Dim Codearray() As String ' It's the array of text
    20.         ' Dim currentline As String ' The currentline of Text
    21.         ' Dim Line As Integer ' Dunno why I can't use somthing smaller ...
    22.         ' Dim I As Byte 'Smallest thing
    23.         ' Codearray = Split(source, vbCrLf) ' split Code array from source at Center Left
    24.         ' For I = LBound(Codearray) To UBound(Codearray) From lower case to uppercase
    25.         'currentline = Codearray(I) ' Code array for line
    26.         ' Line = LTrim(Replace(Replace(currentline, " ", ""), vbTab, "")) ' add auto tab
    27.         ' Select Case Left() ' the left case
    28.         ' Case "//" ' comments
    29.         'rtb.Text = currentline ' trb on current line
    30.         ' rtb.SelectedText = Len(currentline) ' select text
    31.         'End Select
    32.         'Next
    33.         'rtb.SelectionFont = New Font(rtb.SelectionFont, FontStyle.Bold)' make her bold!
    34.     End Function
    35.     Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RTB2.TextChanged
    36.  
    37.     End Sub
    38.  
    39.     Private Sub EditorToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EditorToolStripMenuItem.Click
    40.         Me.Hide()
    41.     End Sub
    42.  
    43.     Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
    44.         Dim Fn As String ' call this as string
    45.  
    46.         OFD2.Filter = "Chaos Code Program (*.ccp)|*.ccp" ' make type .ccp
    47.         OFD2.FilterIndex = 1 ' use .ccp
    48.         Fn = OFD2.ShowDialog() ' show the Open dialog
    49.         If Fn = "" Then Exit Sub ' if the text is nothing then exit (no workie)
    50.  
    51.         If Fn <> "" Then ' if it doesn't equel nothing then open file, also no workie
    52.             ' OFD2.OpenFile() ' No workie
    53.         End If
    54.     End Sub
    55.  
    56. End Class

    I'm stumped
    Last edited by Word2; Aug 1st, 2004 at 08:45 PM.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width