Click here to Skip to main content
15,905,028 members
Home / Discussions / C#
   

C#

 
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 
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 
Hi Phil,

two ideas:

1.
the DroppedDown property manipulation should not be there at all; it is not
needed to swap frame names; if your app needs it, put it elsewhere (or
modify your method name)

2.
you might want to use SelectedItem instead of SelectedIndex; this should
even work if the selected index is different from oldIndex/newIndex;
it will fail if your ComboBox holds duplicates (not a good idea anyhow)
private static void SwapFrameNames(ComboBox cb, int oldIndex, int newIndex) {
    // remember current selection
    object sel=cb.SelectedItem;
    // unselect everything
    cb.SelectedItem=null;
    // swap
    object temp = cb.Items[newIndex];
    cb.Items[newIndex] = cb.Items[oldIndex];
    cb.Items[oldIndex] = temp;
    // restore selection if any (was null, so must search index now)
    cb.SelectedItem=sel;
}


Hope this helps.

Smile | :)



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 
GeneralRe: Ajax slowing my search??? Pin
Steve Echols12-Jul-07 15:32
Steve Echols12-Jul-07 15:32 
GeneralRe: Ajax slowing my search??? Pin
Chris McGlothen13-Jul-07 6:04
Chris McGlothen13-Jul-07 6:04 
GeneralRe: Ajax slowing my search??? Pin
Steve Echols13-Jul-07 6:14
Steve Echols13-Jul-07 6:14 
GeneralRe: Ajax slowing my search??? Pin
Larantz13-Jul-07 0:21
Larantz13-Jul-07 0:21 
GeneralRe: Ajax slowing my search??? Pin
Chris McGlothen13-Jul-07 4:34
Chris McGlothen13-Jul-07 4:34 
QuestionHelp with a search & replace Pin
rbuchana12-Jul-07 5:51
rbuchana12-Jul-07 5:51 
AnswerRe: Help with a search & replace Pin
User 665812-Jul-07 6:06
User 665812-Jul-07 6:06 
AnswerRe: Help with a search & replace Pin
Luc Pattyn12-Jul-07 6:12
sitebuilderLuc Pattyn12-Jul-07 6:12 
QuestionProblem Connecting to MQ on unix from .NET application Pin
unnamed00712-Jul-07 4:51
unnamed00712-Jul-07 4:51 
QuestionString containing digit or Alphabet Pin
t4ure4n12-Jul-07 4:33
t4ure4n12-Jul-07 4:33 
AnswerRe: String containing digit or Alphabet Pin
User 665812-Jul-07 4:43
User 665812-Jul-07 4:43 
AnswerRe: String containing digit or Alphabet Pin
Luc Pattyn12-Jul-07 4:45
sitebuilderLuc Pattyn12-Jul-07 4:45 

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.