Save Menu Option Sytax Error?

Aug 1, 2010

I have written a sub routine for a Save>Menu option for a MDI Text Editor, see my code below

Private Sub SaveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click
Dim f As Form2

[Code]....

Now if I take out the ( I get yet another error which states

"Argument not specified for perameter "File" of public sub WriteAllText(File as string, text as string, append as boolean)

All I want is when the user clicks the save menu item the document either saves the changes made to the current document or the save as routine is involked.

View 4 Replies


ADVERTISEMENT

Writing The Save Option - Code Up The Save Menu Option So That It Updates The Current Document?

Jun 10, 2010

I am writing a text editor program and I have written the new, open, save as, exit menu items but I am struggling with writing the save option.Now I have created the menu itself (well vb did, I just used insert standard items) but how do I code up the save menu option so that it updates the current document or if the documnt has not yet been saved bring up the save file dialog.Here is the code I have so far

Public Class Main
Private Sub NewToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewToolStripButton.Click, NewToolStripMenuItem.Click[code]....

I know I have some finishing touches such as messages and error handling and stuff but at the moment I want to get all the basics working,I think the save menu option is all I am struggling with at the moment.

View 1 Replies

Cant Get The Save As Menu Option To Work Correctly?

Aug 5, 2010

I have written an MDI text editor, its almost complete, but I cant get the save as menu option to work correctly.

HTML
'This sub routine controls the save as menu option
Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles[code].......

So whats happening is that it opens the dialog ok, saves the document to my chosen location correctly, but opens a new document and gives the new document my chosen file name and leaves my saved document with the file name New Document.But when I close all the open screens and then re-open my saved document its all as it should be.

View 1 Replies

Sub Routine For A Save>Menu Option For A MDI Text Editor?

Mar 11, 2010

i have written a sub routine for a Save>Menu option for a MDI Text Editor, Please see my code below

Private Sub SaveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click
Dim f As Form2
If f.Text = "Text Editor V.2 - New Document" Then

[Code]...

View 1 Replies

Asp.net - Must Declare Scalar Variable When It Is Already Defined And Sytax Error Near 'nvarchar' When Updating

May 16, 2012

Solution at the bottom. I receive the following error when trying to update records: Must declare Scalar Variable @PaymentTermID Problem is, @PaymentTermID should be defined already in the Update parameters. The 2 functions for onrowdatabound and onrowupdate are tweaked versions of the ones found here for the DropDownList: GridViewRow.DataItem Property. Delete works fine. No new lines are added, just names changed around. I am not exactly used to working with asp objects.

[Code]...

View 1 Replies

"exit" Option In Menu Strip Remind The User To Save Their Settings

Jun 24, 2010

I'm just trying to have my "exit" option in my menu strip remind the user to save their settings...If they haven't, the click "no" and save their stuff, and then exit. I can't get the form to close if I hit "yes."

[Code]...

View 4 Replies

Edit Excel Document And Save As Option Error

Feb 4, 2012

I was trying to edit a excel document and save under different name and my coding for this is as follows.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Open
Dim MyExcel As New Excel.Application
MyExcel.Workbooks.Open("C:\Test\WalkAir.xlsx")
'Extract
MyExcel.Sheets("sheet1").Activate()
[Code] .....

While debugging the code it resulting with me an error message as Public member 'SaveAs' on type 'ApplicationClass' not found.

View 2 Replies

How To Handle Input - Console Application - Click One Option On Windows Context Menu And Another Function When You Click Another Option

Jul 28, 2009

I want my console application to be able to do one function I have when you click one option on the windows context menu, and another function when you click another option.

View 3 Replies

VS 2008 MENU Bar - Don't Have The "Step Into Option" From My DEBUG Menu

Aug 7, 2009

Two(2) Things. I don't have the "Clickonce Option" when I select BUILD for the menu bar. I also don't have the "Step Into Option" from my DEBUG menu. Do I have a problem? Or do I need to turn something on?

View 4 Replies

Save ListBox1.Items To Txt File Using Save As Option VB 2008 EE?

Aug 1, 2009

I have researched the net, youtube, and the msdn DB, and still can not find the working answer I am looking for. I would like someone to show me how you would save the contents of "Listbox1" to a .txt file using the "Save As" Option. I know how to hardcode a savepoint in, but since there will be multiple users I would like the option to be up to the end-user.

View 4 Replies

VS 2008 Set Up App That Has Menu And Have Each Option Run On Different Thread

Mar 27, 2010

I am trying to set up an app that has a menu and have each option run on a different thread. When I set up 2 thread to run I get the following error: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThread Attribute marked on it. This exception is only raised if a debugger is attached to the process.From what I have researched, it says to make sure the openfile dialog function should be used with the main thread only. Since I have <STAThread()> added above the main I'm not sure how else to handle this. The main thread needs to be listening for the menu options and if I change it around it runs that option and the other threads hang. [code]

View 4 Replies

IDE :: Set As StartUp Project Menu Option Does Not Exist

Apr 2, 2009

I am learning Visual Basic Express 2008. When I follow step #5 below, the option Set as StartUp Project does not exist. How I can accomplish this. To create a test project for your class. Open the Persons project that you created in the previous lesson. If you did not save it, you will first have to go back to the previous lesson, Adding Methods to a Class, and complete the procedures.

On the File menu, point to Add, and then click New Project.
On the Templates pane in the New Project dialog box, click Windows Forms Application.
In the Name box, type PersonsTest and then click OK.
A new Windows Forms project is added to Solution Explorer, and a new form appears.

In Solution Explorer, select the PersonsTest project, and then on the Project menu, click Set as StartUp Project. In the Solution Explorer, select the PersonsTest project, and then on the Project menu, click Add Reference. The Add Reference dialog box appears.

Click the Projects tab, and then select Persons and click OK.
Double-click the form to open the Code Editor, and then enter the following declaration just under the line Public Class Form1.

View 7 Replies

Option Strict - Error Option Strict On Disallows Implicit Conversions From 'Object' To 'XtremeCalendarControl.CalendarControl'

Oct 17, 2009

How can I get round this error: Option Strict On disallows implicit conversions from

[Code]...

View 4 Replies

VS 2008 - Add An Option To Windows Explorer Right Click Menu?

May 1, 2010

I did some research and i found that i will need to edit the registry.So if i make a folder called "Get Path" in the ContextMenuHandlers folder.When i click on the file in windows explorer or desktop etc i will have the option called "Get Path".Now for the value key what do i put inside?What i want is when the user right - clicks on the file my program starts up and displays the path of that file on a msgbox or listbox. I was thinking of letting the Windows Installer (.msi) doing this for me.

View 37 Replies

VS 2008 : Assign Ctrl+s To Automatically Save The Labels Text Once Pressed Instead Of Going Through A Menu To Choose Save?

Jan 20, 2011

so i have a quite huge program. but lets say i have one label. and i want to save that. i have the code and everything for saving the text of the label. now i want to assign ctrl+s to automatically save the labels text once pressed instead of going through a menu to choose save.this is like a regular texteditor where u press ctrl+s and it saves.

ive used this

If (e.KeyCode = e.Control & Keys.S) Then
MessageBox.Show("Ctrl+S pressed")
End If
and

[code]....

but it doesn't do anything once pressed.im also using the keydown declaration for the form.

View 4 Replies

Paint Event - Add A Button To A Form Each Time The User Clicks A Menu Option

Apr 17, 2009

[Code]....

I add a button to a form each time the user clicks a menu option as:

[Code]....

This draws a small blue line at the bottom of the button to show it is highlighted. Just like the mouseoverbackcolor property on a button except this will draw the line. It works fine until you slide the mouse very fast between the buttons. It is as if the mouseleave event doesnt always fire.

View 2 Replies

Option Strict On - Error On All The ".Cells" Lines Saying Option Strict On Disallows Late Binding

Sep 7, 2010

I turned Option Strict On and i get an error on all the ".Cells" lines saying option strict on disallows late binding.

a = 1
b = 3
c = 2
d = 1
With oSheet

[CODE]..................

View 4 Replies

Using Save All Option Without Quitting Out Of VS

Nov 11, 2008

I only just now realized that the project does not update when it saves until you quit out of Visual Studio. As such I now have 7 backups that are exactly the same, including the main file. I would have lost hours of work if not for finding a copy that somehow had all of my work saved to it. It was named the same thing as four other projects, though, with the other three being the same work from hours ago. Where is this temporary project? I cannot find it on my computer, and I'm afraid of losing all that work. Also, is there a way to do a Save All, and then something like "Save the whole project as" without quitting out of Visual Studio, looking through folders, finding the actual project folder, and copy pasting that? In other words, is there a way to do that in Visual Studio itself?

View 3 Replies

(Save As Type) Option Not Showing Up

Oct 19, 2011

I am trying to save a file and I want to limit the user to a couple options being *.txt and I want to make the default *.txt. The code works to save the file, but I don't see the "save as type" option as having any choices and the default .txt extension is not in the file name field.

Private Sub SaveFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles SaveFileDialog1.FileOk
'Write the converted string to the file
Dim FileToSaveAs As String = SaveFileDialog1.FileName
Dim FileWriter As New StreamWriter(FileToSaveAs)
[Code] .....

View 1 Replies

Save Checkboxes As Custom Option?

Sep 2, 2009

I have a form with multiple checkboxes what I would like to do is to have it that if someone selects any combination of the checkboxes they could save those selections by pressing a button named save options or something to that affect it would then save those selections then they could load them by pressing another button load options and run them with another button named run options (or the box that loads could run too) not sure the best way to do it the goal is ultimately to have a button that allows the state of the checkboxes to be saved and then run as a custom option.

how would I do this I cannot find anything on the Internet ?

View 12 Replies

WPF - Option For User To Save Artwork As JPEG File

Apr 12, 2009

I am trying to create a wpf program that allows the user to create custom shapes or pick premade shapes and that after making their selection, a canvas shows their shapes randomly sized, positioned, colored and copied in multiples. I am hoping that on click, the program will put its output on a time interval and that the user can click stop when they are satisfied with how everything looks. My issue is, I would like to also give the user an option to save their created artwork as a jpeg file. Also if I wanted to link this file to a web browser what will I have to do?

View 1 Replies

Create Menu ( In Taskbar) - This Gives Only The Option "ContextMenuStrip"?

Sep 10, 2010

how i can create menu ( in Taskbar) in my Program? this give me only the Option "ContextMenuStrip"

View 1 Replies

Cannot Find "build" Option In VB 2010 Menu

May 6, 2010

In VB 2008 Express, in the top menu, there is "Build" (Between Project and Debug), but it's not there in VB 2010 Express. I tried to find an option for it in Tools, but I can't find it. I can use the Build menu in VB2008 to build an .exe that shows up in the "Release" folder. What can I do to make an .exe as a release, so that I can implement it? If I was to use the .exe in the "Debug" folder, I can only run it in Debug mode.

In VB2010, I can right-click on the area near the toolbar and choose "build", which makes 2 buttons appear. I can click on the Build" button, but it does not create a new .exe in the "Release". Sorry if the solution is really simple, but I am a newbie, and I've only recently converted to VB 2010 Express. I can't believe how difficult this problem is!

View 9 Replies

Save Excel File - Option For User To Overwrite If Already Exists

Feb 10, 2009

I'm trying to save an excel file:
vb.net
xlWBook.SaveAs("J:DOWNLOADS.xls")
xlWBook.Close()
xlApp.Quit()

If the file already exists excel will open an message box and ask if you want to overwrite. If I click yes, it works. If I click no or cancel, I get an error:
Exception from HRESULT: 0x800A03EC
How can I tell what button the user clicked?

View 3 Replies

How To Save Sites Into App Favourite Menu

Aug 5, 2011

I made a web browser and I wanna to add to it the favourite menu feature how?

View 3 Replies

Save Dialog Coding - Set Up Along With The Menu Bar ?

Apr 10, 2009

I've got everything set up along with the menu bar etc. Could anyone show/explain to me the code for the save dialog?

View 3 Replies

Using Settings Save With Menu Strip?

Feb 21, 2010

I have coded my application to run at startup now this is done by clicking the "run at startup" submenu from the menu strip I'm using when it's click the submenu auto checks and adds a key in the registry to make the form load at startup now I want to make the form "remember" the checked state of the menu even after form restarts I read somewhere that I can do that with the my.settings code

Private Sub SettingsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SettingsToolStripMenuItem.Click
If SettingsToolStripMenuItem.CheckState = CheckState.Unchecked Then

[Code].....

View 3 Replies

VS 2008 Menu Save In This Program?

May 21, 2009

Public Class Form1
Dim ISsaved As Boolean
Dim Fpath As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
OpenFileDialog1.Title = "Open File RTF"

[code]....

source above is parts of my source code.i'm learning to make a simple wordpad.when i edit some text in RTF file and then i choose SAVE,why command to save my file to computer appear(like SAVE AS in Microsoft Word)? i think i have saved my file in computer before that.

View 1 Replies

VS 2008 SAVE Menu In Wordpad ?

Jun 1, 2009

Public Class Form1
Dim ISsaved As Boolean
Dim Fpath As String

[Code]....

source code above is a part of my wordpad's source code. in my wordpad,why SAVE menu(SaveToolStripMenu) is function like a SAVE AS menu?

for example:i save a RTF file in my PC.and then i open it with my wordpad and edit that file.when i click SAVE menu,why this wordpad command me to save this file?I think this file is saved before.

View 3 Replies

.net - Save Context Menu Items In My.settings?

Jan 12, 2010

How can I store the items in a context menu strip in the Settings so they are in the context menu when the application is next started?

Or is there a better way than using settings? (they are recently opened files in the cms)

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved