locked
newbie needs help quickly! RRS feed

  • Question

  • my question may seem simple- but to me it is a mountain of mayhem!

    what i am trying to do is make a "navigational screen" that the user can click on "buttons" to go to that form. I have so far 3 destinational buttons on form 1..when you click the first button..the code runs and a new window opens up. when i copy and paste the code i used for form 1..and change the destinations to form2..i get all errors. LOL..finally i got it to where there is no error in code, but when debug runs..button 1 opens a new window...button 2 does not..hehehee...there has got to be a easy solution!!

    someone please please help me!

    thanxxXX :)

    • Moved by Bessie Zhao Monday, April 19, 2010 3:11 AM (From:Visual Studio Tools for Office)
    Tuesday, April 13, 2010 12:19 PM

All replies

  • my question may seem simple- but to me it is a mountain of mayhem!

    what i am trying to do is make a "navigational screen" that the user can click on "buttons" to go to that form. I have so far 3 destinational buttons on form 1..when you click the first button..the code runs and a new window opens up. when i copy and paste the code i used for form 1..and change the destinations to form2..i get all errors. LOL..finally i got it to where there is no error in code, but when debug runs..button 1 opens a new window...button 2 does not..hehehee...there has got to be a easy solution!!

    someone please please help me!

    thanxxXX :)

    • Merged by Bessie Zhao Friday, April 16, 2010 5:23 AM same topic
    Tuesday, April 13, 2010 12:11 PM
  • You forgot to mention the ERROR :) that is?

    Do a Try/Ctach in your Method


    Please give some feedback if i did help you! Best Regards Joao Livio
    Tuesday, April 13, 2010 1:40 PM
  • well as i said i am very new at this and here is what i did..and its not doing what i want :(

    I created a new windows application. I named this "home1"

    I then commenced to making 6 buttons. what i want these buttons to do is to each open to a different form. for example:

    button one..(Name:) btnDay..i want this button when clicked to open a form to see a day view of the appointments. I went to projects-add new windows form- named it frmDay.vb

    button two..(Name:) btnWeek..i want this button to open a new form to show the week view of appointments. I went to projects-add new windows form- named it frmWeek.vb

    button three..(name: )btnMonth..i want this button to open to a new form showing appointments made for the month. (so somehow ...lol..after i figure out how to make the buttons open to these new forms..the month view is gonna have the information from day and week in this one.) but thats later...cuz right now i cannot get the buttons to open into new forms:(.

    This is the code i am using for btnDay: double clicking on the button places this button under general declarations.

    When i check it to see if its working I get this:

    Private

     

    Sub btnDay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDay.Click

     

    If frmDay Is Nothing Then

    frmDay =

     

    End If

    frmDay.Show()

     

    End Sub

    End

     

    Class

     

    I just dont get it..what the ____ am i doing wrong :(. you would think that it would be easy to have 6 buttons sitting on a page..and each of the six buttons to open to their own forms :(...just dont get it!

     

    New frmDay  ERROR HERE: PROPERTY CAN ONLY BE SET TO NOTHING
    • Edited by dcurvez Tuesday, April 13, 2010 3:16 PM typo
    Tuesday, April 13, 2010 2:50 PM
  • Is this your problem? open a form only once?

    private Form myform2= new Form2(); //in class member declaration
    
    
    //in button1 and button2 click events, based on your logic..
    if  (myform2 != null)
       myform2.Show();
    
    //hope this helps!

    In a MDI, change to your needs

    Dim xForm As YourFormName
    For Each childForm As Form In Me.MdiChildren
        If childForm.[GetType]() Is GetType(YourFormName) Then
            childForm.Focus()
            Return
        End If
    Next
    xForm = New YourFormName()
    xForm.MdiParent = Me
    xForm.Show()

    Walkthrough: Debugging an Add-In Project
    http://msdn.microsoft.com/en-us/library/f7fb383x.aspx

     NOTE: When you say "needs help quickly" in yout TOPIC, every questions here are urgent to all users, you have to whait.


    Please give some feedback if i did help you! Best Regards Joao Livio
    Tuesday, April 13, 2010 3:29 PM
  • yes your right, i didnt quite think about it like that as far as everyones questions are important..so in the future i will not use that as a subject line.

    as far as the problem, i am having..i just simply dont understand how to code this :(

    i want btnDay to open to frmDay. On that form..i want to be able to put my appointments in for the day and save the appointments to the day form and to the week form and to the month form. I have only been learning this whole thing for a week. i dont know squat LOL. I want to be able to push the day btnDay ...have my appointments that i made for that day to appear..and save on closing. I dont know if what i did will work, but I now have a new window opening for each one of my buttons :)..not sure if my code will work in the long run..but for now i have a new form for each button, and that is a good thing. As far as saving and stuff..i understand that has to be done on each form independently.

    but no..to answer your question, the initial problem was not getting the form to open only once..LOL..it was getting the forms to open PERIOD. i now have a form opening for each button.

    so..i want to thank you for taking the time to reply, i know this is probably a very simple thing for you..but for me it isnt, as i havent been in this for very long :(

    Tuesday, April 13, 2010 4:05 PM
  • Ok!

    Lets resume please

    1 - How many forms do you have to be open?

    2 - Do you want to pass data between forms?

    3 - Do you want any form in some phase that still open without the user can be able to touch the other ones?

    4 - What code do you need, pass the appointments from form 1 to form 2 and save?

    Do you REALLY need to do this this way?, why not to open a form and display each feature in a tab in a TabControl?, if you do that all features are in the same class.


    Please give some feedback if i did help you! Best Regards Joao Livio
    Tuesday, April 13, 2010 6:45 PM
  • Are you developing a VSTO Solution or a simple Windows Forms application? If you are trying to create a Wizard in Windows Forms applilcation the below article has a nice walkthrough http://www.differentpla.net/content/2005/02/implementing-wizard-c

    Thanks,

     

     


    Navneet
    Tuesday, April 13, 2010 6:47 PM
  • :)...yes..:)

    that last post was a huge help! right now, I am trying to make a day calendar, a week calendar and a month Calendar..all in the same program. I do not know ANYTHING lol! i only know what i need it to do..and to be honest with you i am learning this on the fly. I am very good with software and can grasp thing pretty quick if only pointed in the right direction. However, this is the first time i have attempted to make some (started 8 years ago a bit, but had to put it away due to the family) But..anyway, back to what i am trying to accomplish:

    i am trying to make these calendars without the "calendar Control" because i dont really understand what it does or how it works..all i know is that it is ugly LOL..AND because I am trying to only do 3 months at a time.

    yes..i would love to be able to write on lets say..the day menu..and have it automatically update to the week and the month views.

    the problem is is that i dont know much if anything about how to get this done. I am learning as i go.

    AND if all this could be somehow saved into excel workbooks..man o man would that be GREAT :)

    so far i have made my notepad...made my calculator..and created what i call "navigational screen" this screen is where i am placing buttons to go to other places..like to the calculator..or to the day calendar..and this is the screen i was having a hard time with. at the moment i have all the different "navigational buttons" opening to their own windows..lol..but this morning they were not doing that, thus the frantic behavior LOL

    so please...please..please..if ya got any hints about accomplishing ANY of the above issues..i would so much love ta hear them, just please kinda remember I DONT KNOW SQUAT...yet...:)

     

    Tuesday, April 13, 2010 8:41 PM
  • i am gonna go read up on "tab Control" and see cuz the way you described it..that may just be the best way and the easiest..:)

    Tuesday, April 13, 2010 8:59 PM
  • Hello,

    From a same thread posted by you, it seems that you are not working with VSTO solution. I will merger these two threads.

    Actually, this question is off-topic in this forum. However, it seems that you have found a solution for this question by working withJoao Livio. So I will close this thread. If you have any concern for this, please refer to this forum'sPLEASE READ FIRST to find more entry links for non-VSTO issues.

    Best regards,
    Bessie


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Friday, April 16, 2010 5:21 AM