Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


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


22 Jul 2012   #1

Windows 7 Ultimate 32bit
 
 
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 System SpecsSystem Spec
.

22 Jul 2012   #2

Windows 7 Ultimate x64
 
 

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 System SpecsSystem Spec
24 Jul 2012   #3

Windows 7 Ultimate 32bit
 
 

Quote   Quote: Originally Posted by Alejandro85 View Post
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 System SpecsSystem Spec
.


26 Jul 2012   #4

Windows 7 Ultimate x64
 
 

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 System SpecsSystem Spec
28 Jul 2012   #5

Windows 7 Ultimate x64
 
 

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 System SpecsSystem Spec
Reply

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




Thread Tools




Our Sites

Site Links

About Us

Find 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 10:55 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33