Click here to Skip to main content
15,895,494 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: Image-Listbox Pin
jphuphilly30-Jun-03 11:35
jphuphilly30-Jun-03 11:35 
Questionwho knows sth. about FolderNameEditor? Pin
gongxiancao30-Jun-03 2:48
gongxiancao30-Jun-03 2:48 
GeneralToolbars, main menus & context menus Pin
hbandarra29-Jun-03 23:48
hbandarra29-Jun-03 23:48 
GeneralRe: Toolbars, main menus & context menus Pin
hbandarra30-Jun-03 3:19
hbandarra30-Jun-03 3:19 
GeneralDeserializing dynamically loaded types Pin
Oyvind Bratland29-Jun-03 22:26
Oyvind Bratland29-Jun-03 22:26 
Generalopacity of panels Pin
Member 138827529-Jun-03 21:39
Member 138827529-Jun-03 21:39 
QuestionSerialize into the appropriate App.exe.config file? Pin
Anonymous29-Jun-03 17:59
Anonymous29-Jun-03 17:59 
GeneralKeyword.... Pin
Steve McLenithan28-Jun-03 17:41
Steve McLenithan28-Jun-03 17:41 
GeneralRe: Keyword.... Pin
Bo Hunter28-Jun-03 18:19
Bo Hunter28-Jun-03 18:19 
GeneralRe: Keyword.... Pin
Steve McLenithan28-Jun-03 18:36
Steve McLenithan28-Jun-03 18:36 
QuestionHow Do I: Write an Addin for IE in C# Pin
Rahul Singh28-Jun-03 13:48
Rahul Singh28-Jun-03 13:48 
AnswerRe: How Do I: Write an Addin for IE in C# Pin
Mazdak29-Jun-03 4:32
Mazdak29-Jun-03 4:32 
AnswerRe: How Do I: Write an Addin for IE in C# Pin
J. Dunlap29-Jun-03 8:32
J. Dunlap29-Jun-03 8:32 
GeneralRe: How Do I: Write an Addin for IE in C# Pin
leppie29-Jun-03 9:35
leppie29-Jun-03 9:35 

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.