Click here to Skip to main content
15,923,689 members
Home / Discussions / C#
   

C#

 
GeneralAdd Flash movie to the mdi form Pin
amalatsliit31-Oct-04 21:24
amalatsliit31-Oct-04 21:24 
GeneralRe: Add Flash movie to the mdi form Pin
Corinna John1-Nov-04 0:13
Corinna John1-Nov-04 0:13 
GeneralGetChanges problem with deleting child row Pin
maqster31-Oct-04 21:11
maqster31-Oct-04 21:11 
GeneralWindows Forms disable user input Pin
Lyhr31-Oct-04 20:48
Lyhr31-Oct-04 20:48 
GeneralRe: Windows Forms disable user input Pin
jeweladdict2-Nov-04 11:51
jeweladdict2-Nov-04 11:51 
GeneralRe: Windows Forms disable user input Pin
Lyhr2-Nov-04 20:24
Lyhr2-Nov-04 20:24 
GeneralSet Multiselected Listbox Data Pin
Hemant_Mane2003@yahoo.com31-Oct-04 20:43
sussHemant_Mane2003@yahoo.com31-Oct-04 20:43 
GeneralRe: Set Multiselected Listbox Data Pin
mohit_kinalekar1-Nov-04 1:56
mohit_kinalekar1-Nov-04 1:56 
To set multiple selections in a list control programmatically

Loop through the control's Items collection and set the Selected property of every individual item.

Note You can only select multiple items if the control's SelectionMode property is set to Multiple.

The following example shows how you can set selections in a multi-selection ListBox control called ListBox1. The code selects every other item.

' Visual Basic
Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer
Dim li As ListItem
For Each li In ListBox1.Items
i += 1
If (i Mod 2 = 0) Then
li.Selected = True
End If
Next
End Sub

// C#
public void Button1_Click(object sender, System.EventArgs e)
{
// Counter
int i = 0;
foreach(ListItem li in ListBox1.Items)
{
if( (i%2) == 0)
{
li.Selected = true;
}
i += 1;
}
}

I hope this will solve ur query.
I do not know any other way of doing it. If u find one let me know Smile | :)

ref: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskdeterminingselectioninlistbox.asp

Cheers,

Mohit
Generalcreate MSN Messenger type status bar popup message box in C# Pin
dashingdracula31-Oct-04 18:34
dashingdracula31-Oct-04 18:34 
GeneralRe: create MSN Messenger type status bar popup message box in C# Pin
Luis Alonso Ramos1-Nov-04 5:31
Luis Alonso Ramos1-Nov-04 5:31 
Generalextracting data into excel Pin
kate_shweta31-Oct-04 18:29
kate_shweta31-Oct-04 18:29 
QuestionHow to do this in C#? Pin
momer31-Oct-04 16:28
momer31-Oct-04 16:28 
AnswerRe: How to do this in C#? Pin
Stefan Troschuetz31-Oct-04 21:05
Stefan Troschuetz31-Oct-04 21:05 
GeneralPrint a String From Server Side C# Pin
macsgirl31-Oct-04 14:27
macsgirl31-Oct-04 14:27 
GeneralReflection help - child classes Pin
David Wengier31-Oct-04 14:22
David Wengier31-Oct-04 14:22 
GeneralRe: Reflection help - child classes Pin
David Wengier31-Oct-04 17:04
David Wengier31-Oct-04 17:04 
GeneralDownloader and Install files from the WEB (Like the Windows Updates) Pin
programming31-Oct-04 12:04
programming31-Oct-04 12:04 
GeneralRe: Downloader and Install files from the WEB (Like the Windows Updates) Pin
kaptaintens31-Oct-04 13:25
kaptaintens31-Oct-04 13:25 
GeneralVirtual network IPs Pin
bouli31-Oct-04 8:27
bouli31-Oct-04 8:27 
GeneralRe: Virtual network IPs Pin
Dave Kreskowiak1-Nov-04 3:21
mveDave Kreskowiak1-Nov-04 3:21 
GeneralRe: Virtual network IPs Pin
bouli1-Nov-04 4:15
bouli1-Nov-04 4:15 
GeneralRe: Virtual network IPs Pin
Dave Kreskowiak1-Nov-04 6:21
mveDave Kreskowiak1-Nov-04 6:21 
GeneralSetItemData Pin
bouli31-Oct-04 6:54
bouli31-Oct-04 6:54 
GeneralRe: SetItemData Pin
c#amateur31-Oct-04 11:33
c#amateur31-Oct-04 11:33 
GeneralRe: SetItemData Pin
bouli31-Oct-04 11:38
bouli31-Oct-04 11:38 

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.