Click here to Skip to main content
15,919,479 members
Home / Discussions / C#
   

C#

 
AnswerRe: Crystal Report XI issue Pin
Mohammad Dayyan25-Feb-10 20:57
Mohammad Dayyan25-Feb-10 20:57 
GeneralRe: Crystal Report XI issue Pin
Raza Hussain28-Feb-10 23:11
Raza Hussain28-Feb-10 23:11 
Questionblood Pressure Pin
Jassim Rahma25-Feb-10 20:44
Jassim Rahma25-Feb-10 20:44 
AnswerMessage Closed Pin
25-Feb-10 20:53
stancrm25-Feb-10 20:53 
GeneralRe: blood Pressure Pin
Jassim Rahma25-Feb-10 20:56
Jassim Rahma25-Feb-10 20:56 
AnswerRe: blood Pressure Pin
AspDotNetDev25-Feb-10 21:55
protectorAspDotNetDev25-Feb-10 21:55 
GeneralRe: blood Pressure Pin
Jassim Rahma26-Feb-10 18:31
Jassim Rahma26-Feb-10 18:31 
GeneralRe: blood Pressure Pin
AspDotNetDev26-Feb-10 18:48
protectorAspDotNetDev26-Feb-10 18:48 
The tab control is probably the best option if you want the user to have the option of entering both a left and right value. Since the user only sees one tab at a time, that reduces the amount of space used by the controls on the screen. And you only have to interact with the two textboxes in the code.

If, however, you only want the user to enter either a left or a right, you would only need a textbox and either a button or a combobox. The user would enter "999 / 999" in the textbox. If you went with a combobox, you'd just add two items to it: "Left" and "Right". The user would select whichever. If you went with a button, you'd just have the text change when the button is clicked. When it says "Left" and is clicked, it changes to say "Right". And when it says "Right" and is clicked, it changes to say "Left". The code would be something like this:
C#
private void button1_Click(object sender, EventArgs e)
{
	if (button1.Text.ToLower() == "left")
	{
		button1.Text = "Right";
	}
	else
	{
		button1.Text = "Left";
	}
}

Also, if you wanted to add a third item to the combobox that says "Left and Right", the user might then enter text like "999 / 999 | 999 / 999". But you'd want to make it clear to the user that they should type it in that format (a MaskedTextBox is one way to do that).

If you are really ambitious, you could create a custom control that acts like DateTimePicker. The text is displayed like "999 / 999 Left". When the user clicks on "Left" and presses up or down, it changes to "Right" and when the users presses up or down when it says "Right", it changes to "Left". And when the user clicked on one of the numbers, pressing up or down could increment or decrement the numbers (and page up / page down could increment/decrement by increments of 10). You might even be able to get away with that by using a TextBox and using the events (such as key presses and mouse clicks) to create that functionality.
AnswerRe: blood Pressure Pin
Luc Pattyn25-Feb-10 22:22
sitebuilderLuc Pattyn25-Feb-10 22:22 
GeneralRe: blood Pressure Pin
AspDotNetDev25-Feb-10 23:01
protectorAspDotNetDev25-Feb-10 23:01 
GeneralRe: blood Pressure Pin
Jassim Rahma1-Mar-10 21:04
Jassim Rahma1-Mar-10 21:04 
GeneralRe: blood Pressure Pin
AspDotNetDev1-Mar-10 21:10
protectorAspDotNetDev1-Mar-10 21:10 
GeneralRe: blood Pressure Pin
Jassim Rahma1-Mar-10 21:16
Jassim Rahma1-Mar-10 21:16 
GeneralRe: blood Pressure Pin
AspDotNetDev1-Mar-10 21:18
protectorAspDotNetDev1-Mar-10 21:18 
QuestionTranslatable system? Pin
Ted On The Net25-Feb-10 20:24
Ted On The Net25-Feb-10 20:24 
AnswerRe: Translatable system? Pin
Saksida Bojan25-Feb-10 20:30
Saksida Bojan25-Feb-10 20:30 
AnswerRe: Translatable system? Pin
The Man from U.N.C.L.E.25-Feb-10 22:24
The Man from U.N.C.L.E.25-Feb-10 22:24 
QuestionHow to create offline twitter ? Pin
anshach25-Feb-10 20:15
anshach25-Feb-10 20:15 
AnswerRe: How to create offline twitter ? Pin
Harvey Saayman25-Feb-10 20:19
Harvey Saayman25-Feb-10 20:19 
AnswerRe: How to create offline twitter ? Pin
annathor25-Feb-10 21:48
annathor25-Feb-10 21:48 
GeneralRe: How to create offline twitter ? Pin
OriginalGriff25-Feb-10 22:36
mveOriginalGriff25-Feb-10 22:36 
AnswerTry the Twitter API documentation Pin
The Man from U.N.C.L.E.25-Feb-10 22:21
The Man from U.N.C.L.E.25-Feb-10 22:21 
AnswerRe: How to create offline twitter ? Pin
Pete O'Hanlon26-Feb-10 9:56
mvePete O'Hanlon26-Feb-10 9:56 
QuestionMessage Removed Pin
25-Feb-10 20:00
NarVish25-Feb-10 20:00 
AnswerRe: 70-562 Microsoft .NET Framework 3.5, ASP.NET Application Development [modified] Pin
Saksida Bojan25-Feb-10 20:27
Saksida Bojan25-Feb-10 20:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.