Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer
This is the forum to discuss the Wrox book Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer by Rod Stephens; ISBN: 9780470596906
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 3rd, 2011, 08:19 AM
Registered User
 
Join Date: Mar 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 13 Try It!

I think the Try It has the form creation steps backwards. The instructions had me creating the NewItem form first but that itself is the form that is called once the Add Item button is clicked on the AddOrderItems form.

Am I going nuts?

Great book by the way. I wish more programming books were structured like this one.
  #2 (permalink)  
Old March 4th, 2011, 09:05 AM
Rod Stephens's Avatar
Wrox Author
Points: 3,145, Level: 23
Points: 3,145, Level: 23 Points: 3,145, Level: 23 Points: 3,145, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 641
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Quote:
I think the Try It has the form creation steps backwards. The instructions had me creating the NewItem form first but that itself is the form that is called once the Add Item button is clicked on the AddOrderItems form.

Am I going nuts?
You're not going nuts. I was a bit unclear.

I meant to start a new project and then create the new form. Creating the new project makes the initial main form, which you later give controls. It's not that you can create the Add Item form without making the main form, I just meant to add controls to the Add Item form first.

And you don't really need to do it in that order, either. I just think of the Add Item form as the more interesting one so I focused on it first. You're certainly allowed to build them in either order and in many programs I end up jumping back and forth a bit to tweak one form after working on the other makes me think of something I missed.

Quote:
Great book by the way. I wish more programming books were structured like this one.
Thanks! I'm glad you're finding it useful. Post a review when you have a chance. And let me know if you have other questions or comments.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
  #3 (permalink)  
Old December 22nd, 2011, 04:09 AM
Registered User
Points: 23, Level: 1
Points: 23, Level: 1 Points: 23, Level: 1 Points: 23, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Location: Sweden
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Rod Stephens View Post
You're not going nuts. I was a bit unclear.

I meant to start a new project and then create the new form. Creating the new project makes the initial main form, which you later give controls. It's not that you can create the Add Item form without making the main form, I just meant to add controls to the Add Item form first.

And you don't really need to do it in that order, either. I just think of the Add Item form as the more interesting one so I focused on it first. You're certainly allowed to build them in either order and in many programs I end up jumping back and forth a bit to tweak one form after working on the other makes me think of something I missed.



Thanks! I'm glad you're finding it useful. Post a review when you have a chance. And let me know if you have other questions or comments.
I dont't understand:
I did the same mistake as MikerSU and creaded the forms in the wrong order so now when I run the program I end up with the New Item form first.
How do I change the startupsequence so that the first form displayed is the Add Order Items form?

Cheers
/Joakim
  #4 (permalink)  
Old December 22nd, 2011, 11:15 AM
Rod Stephens's Avatar
Wrox Author
Points: 3,145, Level: 23
Points: 3,145, Level: 23 Points: 3,145, Level: 23 Points: 3,145, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 641
Thanks: 2
Thanked 96 Times in 95 Posts
Default

When you create a Windows Forms project, by default the initial form it creates is set as the start up form. To change that, open the Project menu and select Properties. Then on the Application tab, open the Startup Form dropdown and select the form that you want to launch when the program starts.

That's all there is to it. It's easy enough if you know where to look.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
  #5 (permalink)  
Old December 23rd, 2011, 02:21 AM
Registered User
Points: 23, Level: 1
Points: 23, Level: 1 Points: 23, Level: 1 Points: 23, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Location: Sweden
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Rod Stephens View Post
When you create a Windows Forms project, by default the initial form it creates is set as the start up form. To change that, open the Project menu and select Properties. Then on the Application tab, open the Startup Form dropdown and select the form that you want to launch when the program starts.

That's all there is to it. It's easy enough if you know where to look.
Thank's Rod but that didn't work.
I repeated the try-me and created the frames in the proper order and that works fine but I also wanted to try your work-around.

When I open the application tab from the properties I have a drop-down called 'Startup object' which I guess is the one to use. When I open it I only have two choices '(Not set)' and my projectnamen ending with '_Scope.Program'. I'm not allowed to enter data eighter

Nowhere can I find my alternate frame...

Merry x-mas
  #6 (permalink)  
Old December 23rd, 2011, 10:49 AM
Rod Stephens's Avatar
Wrox Author
Points: 3,145, Level: 23
Points: 3,145, Level: 23 Points: 3,145, Level: 23 Points: 3,145, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 641
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Ah, sorry. I was looking at a Visual Basic project.

In C# open the Program.cs file. In the code editor, there should be a line that looks like this:

Code:
Application.Run(new Form1());
That creates a Form1 object and displays it. Just change Form1 to the name of the form that you want to start up with and you should be set.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
  #7 (permalink)  
Old December 29th, 2011, 04:53 AM
Registered User
Points: 23, Level: 1
Points: 23, Level: 1 Points: 23, Level: 1 Points: 23, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Location: Sweden
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Rod Stephens View Post
Ah, sorry. I was looking at a Visual Basic project.

In C# open the Program.cs file. In the code editor, there should be a line that looks like this:

Code:
Application.Run(new Form1());
That creates a Form1 object and displays it. Just change Form1 to the name of the form that you want to start up with and you should be set.
Yes, thankyou that did the job for me.
  #8 (permalink)  
Old December 29th, 2011, 09:51 AM
Rod Stephens's Avatar
Wrox Author
Points: 3,145, Level: 23
Points: 3,145, Level: 23 Points: 3,145, Level: 23 Points: 3,145, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 641
Thanks: 2
Thanked 96 Times in 95 Posts
Default

I'm glad you figured it out

This is actually a little easier in Visual Basic. There you open the project's Property pages (Project > Properties) and on the Application tab you select teh start up form from the "Startup form" drop down.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
  #9 (permalink)  
Old March 29th, 2012, 10:54 AM
Registered User
Points: 15, Level: 1
Points: 15, Level: 1 Points: 15, Level: 1 Points: 15, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2012
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Trying to finish this Try it, but when debug mode passing this
"private void addItemButton_Click(object sender, EventArgs e)
{
NewItemForm dlg = new NewItemForm();
if (dlg.ShowDialog() == DialogResult.OK)" nothing happened.
Watched video several times and read this chapter, but can't figure out where is my mistake?!
  #10 (permalink)  
Old March 30th, 2012, 03:19 AM
Registered User
Points: 15, Level: 1
Points: 15, Level: 1 Points: 15, Level: 1 Points: 15, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2012
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Any ideas??? What have I missed?
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 13 rock1233 BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 October 6th, 2009 12:18 PM
Chapter 13 bwoll BOOK: Beginning Access 2003 VBA 1 June 7th, 2007 03:57 PM
problem in chapter 13 derrida BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 3 July 28th, 2006 02:31 AM
Chapter 13 ElMorenito BOOK: Beginning ASP 3.0 0 January 14th, 2005 01:56 PM



All times are GMT -4. The time now is 09:00 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.