Click here to Skip to main content
15,921,548 members
Home / Discussions / C#
   

C#

 
Questionhow to make snooker/pool/billiard in C#??? Pin
chumairr12-Jul-07 6:32
chumairr12-Jul-07 6:32 
AnswerRe: how to make snooker/pool/billiard in C#??? Pin
Christian Graus12-Jul-07 6:39
protectorChristian Graus12-Jul-07 6:39 
GeneralRe: how to make snooker/pool/billiard in C#??? Pin
Paul Conrad12-Jul-07 6:52
professionalPaul Conrad12-Jul-07 6:52 
GeneralRe: how to make snooker/pool/billiard in C#??? Pin
Christian Graus12-Jul-07 6:58
protectorChristian Graus12-Jul-07 6:58 
GeneralRe: how to make snooker/pool/billiard in C#??? Pin
Paul Conrad12-Jul-07 7:00
professionalPaul Conrad12-Jul-07 7:00 
GeneralRe: how to make snooker/pool/billiard in C#??? Pin
Christian Graus12-Jul-07 7:04
protectorChristian Graus12-Jul-07 7:04 
GeneralRe: how to make snooker/pool/billiard in C#??? Pin
Paul Conrad12-Jul-07 7:06
professionalPaul Conrad12-Jul-07 7:06 
GeneralRe: how to make snooker/pool/billiard in C#??? Pin
Christian Graus12-Jul-07 7:12
protectorChristian Graus12-Jul-07 7:12 
GeneralRe: how to make snooker/pool/billiard in C#??? Pin
Paul Conrad12-Jul-07 7:24
professionalPaul Conrad12-Jul-07 7:24 
GeneralRe: how to make snooker/pool/billiard in C#??? Pin
Zoltan Balazs12-Jul-07 9:27
Zoltan Balazs12-Jul-07 9:27 
GeneralRe: how to make snooker/pool/billiard in C#??? Pin
Paul Conrad12-Jul-07 9:30
professionalPaul Conrad12-Jul-07 9:30 
GeneralRe: how to make snooker/pool/billiard in C#??? Pin
Dan Neely12-Jul-07 9:52
Dan Neely12-Jul-07 9:52 
GeneralRe: how to make snooker/pool/billiard in C#??? Pin
Dan Neely12-Jul-07 9:51
Dan Neely12-Jul-07 9:51 
GeneralRe: how to make snooker/pool/billiard in C#??? Pin
chumairr12-Jul-07 19:40
chumairr12-Jul-07 19:40 
GeneralRe: how to make snooker/pool/billiard in C#??? Pin
Malcolm Smart12-Jul-07 20:59
Malcolm Smart12-Jul-07 20:59 
AnswerTHE RULES Pin
leckey12-Jul-07 8:39
leckey12-Jul-07 8:39 
QuestionCombo Box SwapItem Pin
PhilDanger12-Jul-07 6:18
PhilDanger12-Jul-07 6:18 
Hi everyone,

I'm trying to write a simple swap function for two items in a combo box (this is used for moving an item in a combo box up or down depending on the button the user clicks).

My problem is that when I set ComboBox.DroppedDown = true, when the user clicks the button again while it is dropped down, (or anywhere else besides the combo box) it switches back to selecting the index that was initially selected. This is a problem when they want to move the same item more than one position -- it doesn't follow the user's selection.
/// <summary>
/// Swaps the names of the frames in the combo box.
/// </summary>
private void SwapFrameNames(int oldIndex, int newIndex)
{
    cmbFrames.DroppedDown = true; //drop the combo box down so the user can see what's going on

    //perform the swap
    object temp = cmbFrames.Items[newIndex];
    cmbFrames.Items[newIndex] = cmbFrames.Items[oldIndex];
    cmbFrames.Items[oldIndex] = temp;

    //select the new position so we follow the user's selection
    cmbFrames.SelectedIndex = newIndex;
}


The code works fine if I comment out the first line of the function -- it follows the selection as expected.

Any ideas?

Thanks,

Phil
AnswerRe: Combo Box SwapItem Pin
Christian Graus12-Jul-07 6:28
protectorChristian Graus12-Jul-07 6:28 
GeneralRe: Combo Box SwapItem Pin
PhilDanger12-Jul-07 7:25
PhilDanger12-Jul-07 7:25 
AnswerRe: Combo Box SwapItem Pin
Luc Pattyn12-Jul-07 7:52
sitebuilderLuc Pattyn12-Jul-07 7:52 
QuestionAjax slowing my search??? Pin
Chris McGlothen12-Jul-07 6:12
Chris McGlothen12-Jul-07 6:12 
AnswerRe: Ajax slowing my search??? Pin
Christian Graus12-Jul-07 6:28
protectorChristian Graus12-Jul-07 6:28 
GeneralRe: Ajax slowing my search??? Pin
Chris McGlothen12-Jul-07 6:36
Chris McGlothen12-Jul-07 6:36 
GeneralRe: Ajax slowing my search??? Pin
Larantz12-Jul-07 12:09
Larantz12-Jul-07 12:09 
GeneralRe: Ajax slowing my search??? Pin
Chris McGlothen12-Jul-07 12:57
Chris McGlothen12-Jul-07 12:57 

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.