Welcome to Dream.In.Code
Become a VB Expert!

Join 149,939 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,422 people online right now. Registration is fast and FREE... Join Now!




Buttons dont work anymore

 
Reply to this topicStart new topic

Buttons dont work anymore

cOrillian
12 Jan, 2008 - 05:49 AM
Post #1

New D.I.C Head
*

Joined: 12 Jan, 2008
Posts: 10

I have added the following code into save and load buttons respectivly

CODE

Private Sub save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles save.Click
        SaveFileDialog1.Title = "Specify Destination Filename"
        SaveFileDialog1.Filter = "HTML Files (*.html)|*.html"
        SaveFileDialog1.FilterIndex = 1
        SaveFileDialog1.OverwritePrompt = True
    End Sub


    Private Sub load_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles load.Click
        OpenFileDialog1.InitialDirectory = "C:\"
        OpenFileDialog1.Title = "Select an HTML file"
        OpenFileDialog1.FileName = ""

        txt1.Text = Text.FromFile(OpenFileDialog1.FileName)

    End Sub


It does not work anymore does anybody have any idea why?

This post has been edited by cOrillian: 12 Jan, 2008 - 06:17 AM
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Buttons Dont Work Anymore
12 Jan, 2008 - 09:21 AM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,655



Thanked: 313 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
You got to remember that after setting the dialog attributes you must use the "showDialog()" method to actually show the dialog to the user. This method will also return a dialog result of whether or not they pressed save/ok/cancel/ignore etc.

This method is common to all types of dialogs. So make sure you have the dialog control on your form, set its attributes like you are and then show it using showDialog()

smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 04:35PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month