Click here to Skip to main content
15,906,574 members
Home / Discussions / C#
   

C#

 
GeneralPrint a web page Pin
nahumtakum30-Jun-03 11:08
nahumtakum30-Jun-03 11:08 
QuestionTimer + Thread = what? Pin
RB@Emphasys30-Jun-03 7:43
RB@Emphasys30-Jun-03 7:43 
AnswerRe: Timer + Thread = what? Pin
J. Dunlap30-Jun-03 7:57
J. Dunlap30-Jun-03 7:57 
GeneralRe: C# Memmory allocation Pin
Nemanja Trifunovic30-Jun-03 6:38
Nemanja Trifunovic30-Jun-03 6:38 
GeneralRe: C# Memmory allocation Pin
leppie30-Jun-03 9:22
leppie30-Jun-03 9:22 
GeneralRe: C# Memory allocation Pin
Wesner Moise30-Jun-03 12:45
Wesner Moise30-Jun-03 12:45 
GeneralRe: C# Memmory allocation Pin
Nemanja Trifunovic30-Jun-03 12:54
Nemanja Trifunovic30-Jun-03 12:54 
GeneralRe: C# Memmory allocation Pin
leppie30-Jun-03 13:14
leppie30-Jun-03 13:14 
GeneralRe: C# Memmory allocation Pin
Kannan Kalyanaraman1-Jul-03 1:32
Kannan Kalyanaraman1-Jul-03 1:32 
GeneralC# Memmory allocation Pin
zhyluo200330-Jun-03 6:30
zhyluo200330-Jun-03 6:30 
GeneralMatlab Application Pin
Ahmed Diaa30-Jun-03 6:24
Ahmed Diaa30-Jun-03 6:24 
GeneralActive Directory Searching Pin
soloforce30-Jun-03 6:18
soloforce30-Jun-03 6:18 
QuestionHow to make Key Logger? Pin
aMIR_bILAL30-Jun-03 5:41
aMIR_bILAL30-Jun-03 5:41 
GeneralLinkedLabel in Datagrid Pin
Chris#30-Jun-03 4:47
Chris#30-Jun-03 4:47 
QuestionColoring listview items? Pin
BoozeBomb30-Jun-03 4:41
BoozeBomb30-Jun-03 4:41 
AnswerRe: Coloring listview items? Pin
Roland Bär30-Jun-03 4:58
Roland Bär30-Jun-03 4:58 
GeneralNeed help with Regex Pin
viperxp30-Jun-03 4:15
viperxp30-Jun-03 4:15 
GeneralRe: Need help with Regex Pin
leppie30-Jun-03 13:32
leppie30-Jun-03 13:32 
GeneralRe: Need help with Regex Pin
viperxp30-Jun-03 19:05
viperxp30-Jun-03 19:05 
GeneralRe: Need help with Regex Pin
1-Jul-03 5:22
suss1-Jul-03 5:22 
GeneralImage-Listbox Pin
jphuphilly30-Jun-03 4:13
jphuphilly30-Jun-03 4:13 
GeneralRe: Image-Listbox Pin
Manster30-Jun-03 9:03
Manster30-Jun-03 9:03 
This is what I've done for sending data from one form to another. It's along the lines for what you're looking for.

(1). Declare a public object of your child form in your parent form ex:

public FormNumber2 Form2 = new FormNumber2();

(2). Make sure your listbox (m_ListBox) is declared public on the child form so you can set/get it's data from the parent form.

(3). Declare a string at the top of your child form:

public string m_sFileRemoved;

(4). This code needs to be in your child form.

if( m_ListBox.SelectedItems.Count > 0 )
{
string sSelectedItem = m_ListBox.SelectedItem.ToString();

m_sFileRemoved = sSelectedItem ;

m_ListBox.Items.Remove( sSelectedItem );
}

(5). Put this code in your parent form where you want to get and show the selected file from the listbox.

// read 5a below.
Form2.ShowDialog();
string sFileToBeRemoved = Form2.m_sFileRemoved;
this.Focus();

(5a). This will help you add data to the listbox before you show it (since you declared the control public) from the parent form.

this.Form2.m_ListBox.Items.Add( "File info: string" );


Smile | :)


Hope this helps.
GeneralRe: Image-Listbox Pin
jphuphilly30-Jun-03 11:08
jphuphilly30-Jun-03 11:08 
GeneralRe: Image-Listbox Pin
Manster1-Jul-03 3:59
Manster1-Jul-03 3:59 
GeneralRe: Image-Listbox Pin
jphuphilly1-Jul-03 7:27
jphuphilly1-Jul-03 7: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.