Click here to Skip to main content
16,011,839 members
Home / Discussions / C#
   

C#

 
AnswerRe: Javascript and C# Pin
Pete O'Hanlon11-Aug-08 9:18
mvePete O'Hanlon11-Aug-08 9:18 
AnswerRe: Javascript and C# Pin
led mike11-Aug-08 10:35
led mike11-Aug-08 10:35 
Question[Message Deleted] Pin
tkrn11-Aug-08 8:59
tkrn11-Aug-08 8:59 
AnswerRe: Report Viewer to automatically print? Pin
Wendelius11-Aug-08 9:40
mentorWendelius11-Aug-08 9:40 
Questionhow to select next value in listbox after moving a value from it? Pin
Yawer Iqbal11-Aug-08 7:19
Yawer Iqbal11-Aug-08 7:19 
AnswerRe: how to select next value in listbox after moving a value from it? Pin
User 665811-Aug-08 7:32
User 665811-Aug-08 7:32 
GeneralRe: how to select next value in listbox after moving a value from it? Pin
Yawer Iqbal11-Aug-08 7:48
Yawer Iqbal11-Aug-08 7:48 
GeneralRe: how to select next value in listbox after moving a value from it? Pin
User 665811-Aug-08 7:55
User 665811-Aug-08 7:55 
Yawer Iqbal wrote:
Listbox do not offer any methed in c# like .SetFocus().


Sorry my bad, it's listbox1.Focus();

Yawer Iqbal wrote:
But I cannot hardcode a index number. Requirment is on moving a value next or previous value of moved value should be automatically selected. Problem is, there may be any number of values (0 to n) in listbox and user can selected any value 0 to n from list. What can code for it ?


Handle the MouseDoubleClick event of the listbox, there you can find out which index has been doubleclicked:

private void listBox1_MouseDoubleClick(object sender, MouseEventArgs e)
{
   int selIndex = listbox.SelectedIndex;
   if(selIndex == -1) // no item was selected, doubleclick was outside
      ...
   else
      // an item has been doubleclicked
}


regards

modified 12-Sep-18 21:01pm.

GeneralRe: how to select next value in listbox after moving a value from it? Pin
Yawer Iqbal11-Aug-08 16:51
Yawer Iqbal11-Aug-08 16:51 
Questionweb browser in c#.net2005 windows application Pin
MuraleeKrishnan11-Aug-08 6:46
MuraleeKrishnan11-Aug-08 6:46 
AnswerRe: web browser in c#.net2005 windows application Pin
Manas Bhardwaj11-Aug-08 7:18
professionalManas Bhardwaj11-Aug-08 7:18 
QuestionCollecting Forms from phisical path! Pin
mrcooll11-Aug-08 4:30
mrcooll11-Aug-08 4:30 
AnswerRe: Collecting Forms from phisical path! Pin
Manas Bhardwaj11-Aug-08 4:49
professionalManas Bhardwaj11-Aug-08 4:49 
GeneralRe: Collecting Forms from phisical path! Pin
mrcooll11-Aug-08 4:50
mrcooll11-Aug-08 4:50 
AnswerRe: Collecting Forms from phisical path! Pin
Manas Bhardwaj11-Aug-08 4:59
professionalManas Bhardwaj11-Aug-08 4:59 
GeneralRe: Collecting Forms from phisical path! Pin
mrcooll11-Aug-08 5:06
mrcooll11-Aug-08 5:06 
GeneralRe: Collecting Forms from phisical path! Pin
Pete O'Hanlon11-Aug-08 8:35
mvePete O'Hanlon11-Aug-08 8:35 
AnswerRe: Collecting Forms from phisical path! Pin
Dan Neely11-Aug-08 5:08
Dan Neely11-Aug-08 5:08 
Questionlocal database connection string Pin
Deresen11-Aug-08 3:54
Deresen11-Aug-08 3:54 
AnswerRe: local database connection string Pin
Ashfield11-Aug-08 5:15
Ashfield11-Aug-08 5:15 
GeneralRe: local database connection string Pin
Deresen11-Aug-08 10:41
Deresen11-Aug-08 10:41 
GeneralRe: local database connection string Pin
Ashfield12-Aug-08 19:58
Ashfield12-Aug-08 19:58 
GeneralRe: local database connection string Pin
Deresen12-Aug-08 22:29
Deresen12-Aug-08 22:29 
GeneralRe: local database connection string Pin
Ashfield13-Aug-08 1:50
Ashfield13-Aug-08 1:50 
Questionhow to store PDF document in local database Pin
laziale11-Aug-08 3:51
laziale11-Aug-08 3:51 

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.