Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8826747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:12:57+00:00 2026-06-14T07:12:57+00:00

in vb6 i can easily get the value from childwindow to another childwindow.. for

  • 0

in vb6 i can easily get the value from childwindow to another childwindow.. for example frm1.textbox1.text = frm2.listview.item.selectedindex… how can i do this in wpf?

i have two child window named EmployeProfile and the other one is PrintEmpProfile… in EmployeeProfile window, there is a listview… what i want is if I’m going to click the print button, i can get the value from EmployeeProfile listview….

so far this is what’s I’ve got. this code is inside of PrintEmpProfile

DataTable table = new DataTable("EmpIDNumber");
table.Columns.Add("IDNum", typeof(string));
for (int i = 1; i <= 100; i++)
{
    table.Rows.Add(new object[] { EmployeeProfile.????? });
}

i don’t know how to get all values from EmployeeProfile listview.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:12:58+00:00Added an answer on June 14, 2026 at 7:12 am

    Whenever you open a child window put a reference of the new child window into a collection. I ssume that MyChild is your child window defined in XAML like:

    <Window
        x:Class="TEST.MyChild"
        ...
    

    You can define a static list holding your child windows in App.xaml.cs

    public partial class App : Application
    {
        public static List<MyChild> Children
        {
            get
            {
                if (null == _Children) _Children = new List<MyChild>();
                return _Children;
            }
        }
    
        private static List<MyChild> _Children;
    }
    

    Whenever you open child window add it into this collection like:

    MyChild Child = new MyChild();
    App.Children.Add(Child);
    Child.Show();
    

    You should also remove child from this collection when you close your child window. You can do this in Closed event of the window. Define closed vent in XML:

    Closed="MyChild_Closed"
    

    And in code behind:

        private void MyChild_Closed(object sender, EventArgs e)
        {
            // You may check existence in the list first in order to make it safer.            
            App.Children.Remove(this); 
        }
    

    Whenever a child window wants to access ListView of other child window then it gets reference of the child from the collection and then call ListView defined in XAML directly.

        MyChild ChildReference = App.Children.Where(x => x.Title == "Child Title").FirstOrDefault();
        if (null != ChildReference)
    {
        ChildReference.listview.SelectedIndex = ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a multithreading C# COM-Assembly, I used it from VB6. The C#-COM can
How can i print mix text and graphics using vb6?.., i want the output
How can I convert a string to variable in c# or C++? example (vb6):
Is there any existing JSON parser which can be used from VB6? I could
I need to remove trailing - characters from a string in VB6. How can
Is there a good way to create a form in VB6 that can easily
How can I quickly load a text file into a string using VB6?
Can anyone guide me ,whether is aany method to open a VB6 code from
VB6 IDE can get into a state when the Make XXXX menu option under
Can we host a VB6.0 user control in WPF forms?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.