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 July 28th, 2011, 08:08 PM
Authorized User
Points: 44, Level: 1
Points: 44, Level: 1 Points: 44, Level: 1 Points: 44, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Lesson 4 Try it Exercise

I've been sitting here for 2 days trying to figure out how to create these f'ing scrollbars...I hate when when a book assumes that the reader knows how to do something.ughh

Then i decided to watch the Lesson 4 tutorial..SAME THING...the guy says something along the lines of "Its very easy to create a scrollbar so i wont go over it"....
  #2 (permalink)  
Old July 28th, 2011, 09:05 PM
Rod Stephens's Avatar
Wrox Author
Points: 3,153, Level: 23
Points: 3,153, Level: 23 Points: 3,153, Level: 23 Points: 3,153, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 643
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Sorry about that. If you get stuck like that in the future, post a question and I'll respond as quickly as I can.

HScrollBar and VScrollBar are controls that you can place on a form. Just open the form in the form designer, click on the HScrollBar tool in the Toolbox, and click and drag to place one on the form.

Or double-click the tool on the Toolbox to make one at a default size and position. Then you can drag it around and resize it as needed.

(It's not covered in the screencast because creating controls was covered in Lesson 2. Particularly later in the book, there isn't time to cover stuff that was in earlier lessons unless there's some twist for the most recent lesson.)

Like I said, if you get stuck on something like this, let me know. It's the sort of thing that an instructor could show you quickly if one were there with you in a classroom.
__________________
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 July 28th, 2011, 10:16 PM
Authorized User
Points: 44, Level: 1
Points: 44, Level: 1 Points: 44, Level: 1 Points: 44, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2011
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks so much for the speedy reply, Rod....I think its awesome that you actually come online to answer questions..

I KNEW the scrollbar had to be in the toolbox but for some reason could not find it- so I started to think it was something that I had to create using the other controls. My bad. It was right under my nose.
  #4 (permalink)  
Old July 28th, 2011, 11:04 PM
Rod Stephens's Avatar
Wrox Author
Points: 3,153, Level: 23
Points: 3,153, Level: 23 Points: 3,153, Level: 23 Points: 3,153, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 643
Thanks: 2
Thanked 96 Times in 95 Posts
Default

It doesn't help that there are more than 50 controls in the Toolbox, and you can add even more.

Sometimes you can use the categories (Containers, Dialogs, Printing, etc.) to help narrow down your search. Or you can right-click on it and select Sort Items Alphabetically to get them in order. That makes it easier to find a particular control.
__________________
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 September 12th, 2011, 06:08 PM
Authorized User
Points: 313, Level: 6
Points: 313, Level: 6 Points: 313, Level: 6 Points: 313, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2011
Posts: 74
Thanks: 21
Thanked 2 Times in 2 Posts
Default Conthoroughly Fusing Semantics and Maybe Errata

Quote:
Originally Posted by caa5042 View Post
I've been sitting here for 2 days trying to figure out how to create these f'ing scrollbars...I hate when when a book assumes that the reader knows how to do something.ughh

Then i decided to watch the Lesson 4 tutorial..SAME THING...the guy says something along the lines of "Its very easy to create a scrollbar so i wont go over it"....
I had difficulty with "scrollbars" as well and finally found them in the Toolbox after using something similar and scratching my head for a while. I'm at my MAC (yup...agnostic programmer) here at home and think the Toolbox refers to them as Hbars or similar in Visual Studio 2010.

Spent a few hours trying to size the black label (Try It, Chapter 4 pages 52-53-54) to the right in the Try It example. It won't resize unless you set its Autosize to False. The video doesn't mention setting Autosize to False for the label. Eventually went to whimpering mother Microsoft who has loads of explanations and examples of exactly everything you DON'T need, but this time she had the answer.

There may be an error in the Code at the bottom of page 53, but not 100% sure. Here's what the book has and it causes a error:

private void hbarRed_Scroll(object sender, ScrollEvents e)
{
lblRed.Text = hscRed.Value.ToString();

++++++++++++++

I think it should be this:

private void hbarRed_Scroll(object sender, ScrollEvents e)
{
lblRed.Text = hbarRed.Value.ToString();

Noticed most of the code so far is for Windows applications but I'm going to need it for the web. I know, doesn't really matter, since it ALL applies and it's all good. In many ways programming (beginning that is) for Windows forms seems easier.

It's great to have access to the author: Rod! Thanks!

JJ

Last edited by jpjamie; September 12th, 2011 at 06:19 PM.
  #6 (permalink)  
Old September 12th, 2011, 06:34 PM
Rod Stephens's Avatar
Wrox Author
Points: 3,153, Level: 23
Points: 3,153, Level: 23 Points: 3,153, Level: 23 Points: 3,153, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 643
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Hi JJ,

Unfortunately it's sometimes hard to remember what's not obvious after you've done this for as long as I have. Sometimes something is just mentioned quickly and if you miss it you may have a hard time figuring out what's going on later. The FollowMouse example on page 49 mentions the HScrollBar and VScrollBar controls.

This is the sort of issue that an in-class instructor could clear up in seconds. That's why I really hope people email me or post as soon as they get stuck on something like this.

As for the typo on page 53, you're absolutely right. The two names hbarRed and hscrRed should be the same, and they should be the same as the control's name on the form.

(Following the usual C# naming conventions (which I often don't), the name should probably really be redHScrollBar or something similar. And the labels should have names like greenLabel, redLabel, etc. I think this name got caught up in some control renaming that happened late in the book. Sorry about that.)

If you stumble across anything confusing like this in the future, let me know and I'll help you decipher my mistakes ASAP!
__________________
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 September 12th, 2011, 09:52 PM
Authorized User
Points: 313, Level: 6
Points: 313, Level: 6 Points: 313, Level: 6 Points: 313, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2011
Posts: 74
Thanks: 21
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by Rod Stephens View Post
Hi JJ,

Unfortunately it's sometimes hard to remember what's not obvious after you've done this for as long as I have. Sometimes something is just mentioned quickly and if you miss it you may have a hard time figuring out what's going on later. The FollowMouse example on page 49 mentions the HScrollBar and VScrollBar controls.

This is the sort of issue that an in-class instructor could clear up in seconds. That's why I really hope people email me or post as soon as they get stuck on something like this.

As for the typo on page 53, you're absolutely right. The two names hbarRed and hscrRed should be the same, and they should be the same as the control's name on the form.

(Following the usual C# naming conventions (which I often don't), the name should probably really be redHScrollBar or something similar. And the labels should have names like greenLabel, redLabel, etc. I think this name got caught up in some control renaming that happened late in the book. Sorry about that.)

If you stumble across anything confusing like this in the future, let me know and I'll help you decipher my mistakes ASAP!
WOW thanks for the reply!
If I'd paid more ATTENTION to your FollowMouse example I might have discovered and later associated the VScrollBar and HScrollBar with the code. Oh well live and learn. I have a track record for learning the hard way, which seems to stick it in my thick head better.

I sent the errata to the publisher per the Wrox errata web page, so that's in the works.

Really great to have interaction and access to you for help. I'm most interested in SQL database connectivity with C# and the interesting things we apparently can do with LINQ. I'm coming from (Allaire) Coldfusion and Ben Forta does this same thing with his books, it really helps.

Thanks!
JJ
  #8 (permalink)  
Old September 13th, 2011, 09:18 AM
Rod Stephens's Avatar
Wrox Author
Points: 3,153, Level: 23
Points: 3,153, Level: 23 Points: 3,153, Level: 23 Points: 3,153, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 643
Thanks: 2
Thanked 96 Times in 95 Posts
Default

This book doesn't say too much about SQL or LINQ. SQL programming is a huge topic. To really do it right, you should look at a book about just database programming. (My book Beginning Database Design Solutions talks about database design, but not programming.)

A couple places to start with LINQ:
LINQ Query Expressions (C# Programming Guide)
http://msdn.microsoft.com/en-us/library/bb397676.aspx

http://msdn.microsoft.com/en-us/vcsharp/aa336746
101 LINQ Samples
LINQ can be pretty useful. I just posted a couple more LINQ examples on my C# Helperweb site. You can do the same thing without LINQ but it would be more work.
__________________
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 September 14th, 2011, 05:49 PM
Authorized User
Points: 313, Level: 6
Points: 313, Level: 6 Points: 313, Level: 6 Points: 313, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2011
Posts: 74
Thanks: 21
Thanked 2 Times in 2 Posts
Default Thanks for LINQ linqs (couldn't resist)

Thanks for those great links!
  #10 (permalink)  
Old September 14th, 2011, 06:01 PM
Authorized User
Points: 313, Level: 6
Points: 313, Level: 6 Points: 313, Level: 6 Points: 313, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2011
Posts: 74
Thanks: 21
Thanked 2 Times in 2 Posts
Default VB or C#

Noticed you are a VB MVP.

I've got some limited experience with VB and would like to ask your opinion on what language is better suited for Visual Studio 2010 and ASP.Net for programmers in the trenches.

I'm learning Studio with Imar Spanjaaar's book. His code examples are in both languages, but I'm using C# for no other reason as I think it just fits better.

What are you thoughts?

JJ
 


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
Lesson 5 exercises. thelemur BOOK: Java Programming 24-Hour Trainer by Yakov Fain 9 March 29th, 2013 11:56 PM
Lesson 8 sergeySE BOOK: Java Programming 24-Hour Trainer by Yakov Fain 1 June 29th, 2011 09:49 AM
Lesson 19 Exercise 4 mpthemaster BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer 3 June 11th, 2011 08:54 PM
Lesson 6 Try It zavodney BOOK: Stephens' Visual Basic Programming 24-Hour Trainer 2 June 6th, 2011 10:07 PM
Lesson 3 question soneal777 BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer 1 August 30th, 2010 06:17 PM



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


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