Visual Studio- Windows Forms(Help needed, open a notepad from project)


  1. Posts : 43
    Windows 7 Ultimate 32bit
       #1

    Visual Studio- Windows Forms(Help needed, open a notepad from project)


    Hey Guys,

    I am not sure if this is the right place to post this but i dont know any other or better either.
    Anyone who has any knowledge in Visual Studio Please Step Forward!!

    I am creating a small software from visual studio (2010 pro) but there is this file menu command which i want to open a notepad when clicked so i need to know what is the command to do so...
    And also if someone could help me on how to place an icon of something in the form, and when the icon is clicked the related thing comes up...
    Plus, the calendar doesnt get any smaller, any ideas anybody?

    Thanks.
    Juniorgeek
      My Computer


  2. Posts : 2,468
    Windows 7 Ultimate x64
       #2

    I don't have visual studio installed right now to give a precise, but if my memory serves......

    You can start notepad by using the Process class which has the static method Start that does precisely so. You can use it to run notepad in the event handler of the menu, optionally by passing a parameter to automatically open a file if you want. Look here for more details: Process.Start Method (System.Diagnostics)

    For the icon, you can use an ordinary button with a blank Text property and a picture on it and it will behave much like any ordinary button (notably the Click event) but with a more graphical aspect. The best I can tell right now is that you explore the property sheet of it and see what properties can control the appearance. By trial and error you can discover some interesting things about controls.
    never tried too much with the Calendar, but again, explore the property window.
      My Computer


  3. Posts : 43
    Windows 7 Ultimate 32bit
    Thread Starter
       #3

    Alejandro85 said:
    I don't have visual studio installed right now to give a precise, but if my memory serves......

    You can start notepad by using the Process class which has the static method Start that does precisely so. You can use it to run notepad in the event handler of the menu, optionally by passing a parameter to automatically open a file if you want. Look here for more details: Process.Start Method (System.Diagnostics)

    For the icon, you can use an ordinary button with a blank Text property and a picture on it and it will behave much like any ordinary button (notably the Click event) but with a more graphical aspect. The best I can tell right now is that you explore the property sheet of it and see what properties can control the appearance. By trial and error you can discover some interesting things about controls.
    never tried too much with the Calendar, but again, explore the property window.

    Thanks a lot Alejandro85. Thats very great and useful help! Thanks again.
    And do tell me one thing, do you know a place or any places where i can actually study some commands for the visual studio instead of normal websites which give more of things not wanted...
    thanks again.
      My Computer


  4. Posts : 2,468
    Windows 7 Ultimate x64
       #4

    I would look at some PDF e-books about general programming in C# mainly. Google can point out a couple of them. More advanced topics like object oriented programming also come handy when you handle the basics. What I tend to avoid are tutorials that just give steps without explaining why you're doing that, or some blogs or forum posts that also do that.
    A good forum for that is StackOverflow, or the official MSDN visual studio section, which are more programmer oriented than SevenForums.

    But the most important thing is that you should experiment yourself. There is no better course than try to do some useful app and finding and solving problems on your own. A simple thing to learn is to look at the member lists Intelisense shows and read the tooltips for methods, properties, classes and parameters, often there are good tips right there. And when you're stuck, go and Google a little or ask in the open forums.
      My Computer

  5.    #5

    Hello,
    I have Microsoft visual studio 2012 RC. You are making a notepad program right. So if you wanna open another notepad from the file menu, I guess this is what you have to do:

    I do not know whether this will work for you but do you think you can make the code as a link when you know the location? You got an answer from 'Alejandro85' and he recommended this code syntax: Process.Start Method (System.Diagnostics). I wonder if this would work: System.Diagnostics.Process.Start(notepad.exe). That might work, I haven't used it ever and I am not sure at all. But, most probably it will.

    Do your second problem like that too....
    1. Insert a Picture Box.
    2. Add you picture (you icon).
    3. Double click the Picture Box to get the code editor.
    4. Make sure the event procedure is 'Click'.
    5. Type System.Diagnostics.Process.Start(<whatever you want>.exe).
    This is the same code as your first question and I hope it works.

    As for the calendar not getting smaller, see whether it is docked anywhere. If its not, I do not know.

    I hope these solutions do work and please do not post bad replies. Thankyou
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 06:14.
Find Us