Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 2nd, 2008, 09:01 PM
Registered User
 
Join Date: Jan 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default comobox contain multi value

hi,

i have two comobox one for hour and second for min

//hour
contain value frm 0,1 ,2, 3,...22,23

min
contain value frm 1,2,3....58,59,60


instead of using two comobox i using a single como which
contain val like that

1:0
1:1
1:2
..
..
..
23:0
23:1
23:2

someone give me idea how i perform this task .
thanks

 
Old April 2nd, 2008, 09:25 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I'm not entirely sure I understand what you are asking. Are you looking to create a single combo box with all times from 0:00 thru 23:59 (that's 1440 items)?

-Peter
peterlanoie.blog
 
Old April 2nd, 2008, 09:48 PM
Registered User
 
Join Date: Jan 2008
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes i want to make a clock in comobox

 
Old April 2nd, 2008, 11:00 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Probably easiest to create a nested loop that creates new items for the combo box. Outer loop will be 0-23 and inner loop will be 0-59.

-Peter
peterlanoie.blog
 
Old April 3rd, 2008, 12:55 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Capri,

Are you sure you want to do this? Thats a heck of a big ComboBox, would it not be better to have something like half-hour blocks in there?

If you really do, then Peter is right, create two loops. Just the idea seems kinda anti-user! :)

Rob
The Developing Developer
Currently Working Towards: MCAD C#
My Blog: http://www.robzyc.spaces.live.com
<center>"Nothing can stop the man with the right mental attitude from achieving his goal;
nothing on earth can help the man with the wrong mental attitude".

Thomas Jefferson</center>
 
Old April 3rd, 2008, 08:46 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What's wrong with 2 drop down lists, one for hour, one for minutes? I've never seen a birthday selector that lists every single day of every month of every year in a single drop down. They are always in 3.

-Peter
peterlanoie.blog
 
Old April 3rd, 2008, 09:05 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can even just lump the two together as a UserControl and totally encapsulate all the functionality, so as far as you are concerned, it IS one control? ;)

Rob
The Developing Developer
Currently Working Towards: MCAD C#
My Blog: http://www.robzyc.spaces.live.com
<center>"Nothing can stop the man with the right mental attitude from achieving his goal;
nothing on earth can help the man with the wrong mental attitude".

Thomas Jefferson</center>





Similar Threads
Thread Thread Starter Forum Replies Last Post
multi threading [email protected] BOOK: ASP.NET Website Programming Problem-Design-Solution 1 February 26th, 2007 11:48 PM
Multi Report ...! anukagni Access 2 June 21st, 2006 01:35 AM
multi-multi-multiple Insert with subquery??? jmjyiannis SQL Server 2000 1 May 5th, 2006 02:20 PM
Multi Parameters jcwc888 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 March 16th, 2006 12:57 PM
Multi-language Lofa ASP.NET 1.0 and 1.1 Basics 2 October 25th, 2005 04:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.