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

  • Home
  • SEARCH
  • 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 9196281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:49:00+00:00 2026-06-17T21:49:00+00:00

I created a folder images inside my project. When the function SetImage() is called,

  • 0

I created a folder “images” inside my project.
When the function SetImage() is called, i want to take the image from /images/image.jpg and place it on my Panel.
The panel declaration on xaml looks like this:

xmlns:my="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"

            <my:WindowsFormsHost Name="windowsFormsHost1">
                <wf:Panel x:Name="panelWinform"  Dock="Fill" />
            </my:WindowsFormsHost>

Example that works ti display a control in the panel:

panelWinform.Controls.Clear();
panelWinform.Controls.Add(controlObject);
controlObject.Dock = System.Windows.Forms.DockStyle.Fill;

How can place the picture instead of the controlObject?
And what does the .clear() does? Do I need to call it again?

  • 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-17T21:49:01+00:00Added an answer on June 17, 2026 at 9:49 pm

    It would be very easy without WinForms. You might have a Grid or some other Panel:

    <Grid x:Name="panel">
    </Grid>
    

    and simply add an Image control to the Panel as shown below.

    public void SetImage()
    {
        var uri = new Uri("pack://application:,,,/images/image.png");
        var bitmap = new BitmapImage(uri);
        var image = new Image { Source = bitmap };
    
        panel.Children.Add(image);
    }
    

    The image URI looks like that because I assume that the image file is a resource in your Visual Studio project. See Pack URIs for some details. You may as well use an absolute or relative file path for the URI.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created one library project in iphone and my images folder is present
I have one created one folder called MYFOLDER inside my folder in have one
I have a Folder called Gallery inside which i have created a folder for
I have an existing directory called /final-fantasy-vii/ which has an /images/ folder inside of
the code down below delete all files inside a folder called Images . No
I created a folder in a TFS Project under workspace CPortalWS. I deleted the
I have created a folder called diagrams in my application. In this folder there
I've created a templatetags folder within my app, with an __init__.py + active.py inside
I need a bash script that get all the images inside some specified folder;
I created two folders inside assets (images and files) both containing some files. I

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.