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. :confused:
This is my main program. It won't load or save.
VB Code:
Option Strict On
Option Explicit On
Public Class Chaoseditor
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
Dim theButton As Long
theButton = MsgBox("Do you wish to exit?", MsgBoxStyle.YesNo)
If theButton = vbYes Then
End
Else
End If
End Sub
Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
Opn.Filter = "GDP Game Developement Project (*.gdp)|*.gdp|All files (*.*)|*.*" ' Open Game Dev Project (No workie)
Opn.FilterIndex = 1
Opn.ShowDialog()
End Sub
Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveAsToolStripMenuItem.Click
Dim SV As SaveFileDialog
SV.Filter = "GDP Game Developement Project (*.gdp)|*.gdp*" ' save as Game Dev Project (no workie)
Sv.FilterIndex = 1
SV.ShowDialog()
End Sub
Private Sub NewToolStripMenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripMenuItem4.Click
CCE.Show() ' Show Chaos Code editor
End Sub
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:
Public Class CCE
Private Sub FileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FileToolStripMenuItem.Click
End Sub
Private Sub CompileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CompileToolStripMenuItem.Click
End Sub
Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripMenuItem.Click
Dim dlg1 As New CCE
dlg1.ShowDialog() ' Pressed new show's new form
End Sub
Function Color(ByVal source As String) As Double
'If Replace(source, " ", "") Then End ' If source "" or " " then end it
Dim rtb As RichTextBox ' name rtb as a RichText Box type
' Dim Codearray() As String ' It's the array of text
' Dim currentline As String ' The currentline of Text
' Dim Line As Integer ' Dunno why I can't use somthing smaller ...
' Dim I As Byte 'Smallest thing
' Codearray = Split(source, vbCrLf) ' split Code array from source at Center Left
' For I = LBound(Codearray) To UBound(Codearray) From lower case to uppercase
'currentline = Codearray(I) ' Code array for line
' Line = LTrim(Replace(Replace(currentline, " ", ""), vbTab, "")) ' add auto tab
' Select Case Left() ' the left case
' Case "//" ' comments
'rtb.Text = currentline ' trb on current line
' rtb.SelectedText = Len(currentline) ' select text
'End Select
'Next
'rtb.SelectionFont = New Font(rtb.SelectionFont, FontStyle.Bold)' make her bold!
End Function
Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RTB2.TextChanged
End Sub
Private Sub EditorToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EditorToolStripMenuItem.Click
Me.Hide()
End Sub
Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
Dim Fn As String ' call this as string
OFD2.Filter = "Chaos Code Program (*.ccp)|*.ccp" ' make type .ccp
OFD2.FilterIndex = 1 ' use .ccp
Fn = OFD2.ShowDialog() ' show the Open dialog
If Fn = "" Then Exit Sub ' if the text is nothing then exit (no workie)
If Fn <> "" Then ' if it doesn't equel nothing then open file, also no workie
' OFD2.OpenFile() ' No workie
End If
End Sub
End Class
I'm stumped:confused: