Results 1 to 7 of 7

Thread: Error setting background image in WPF using Visual Basic, Visual Basic Studio

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2014
    Posts
    13

    Error setting background image in WPF using Visual Basic, Visual Basic Studio

    Hi everybody,

    I get this error message trying to set a background image for my WPF using Visual Basic in Visual Studio 2013 Express:

    "An unhandled exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll

    Additional information: 'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '7' and line position '14'.

    If there is a handler for this exception, the program may be safely continued."

    Here is the XAML:

    <Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525">
    <Grid>
    <Grid.Background>
    <ImageBrush ImageSource="space.jpg"/>
    </Grid.Background>

    </Grid>
    </Window>

    I don't understand what's wrong...

  2. #2
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Re: Error setting background image in WPF using Visual Basic, Visual Basic Studio

    try press Ctrl+Alt+E to show Exception Window, and try to check all Thrown checklist, try it again

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2014
    Posts
    13

    Re: Error setting background image in WPF using Visual Basic, Visual Basic Studio

    I checked off everything in the Thrown checklist, but it still doesn't go through...do I have to have certain things remaining checked in that checklist?

  4. #4
    New Member
    Join Date
    Oct 2014
    Posts
    1

    Re: Error setting background image in WPF using Visual Basic, Visual Basic Studio

    I would review a few of these possible resolutions from the page below as they seem somewhat close to what your issue might be, otherwise head back and we can try again.

    http://stackoverflow.com/questions/1...ension-threw-a

  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2014
    Posts
    13

    Re: Error setting background image in WPF using Visual Basic, Visual Basic Studio

    Quote Originally Posted by Turtlechalk View Post
    I would review a few of these possible resolutions from the page below as they seem somewhat close to what your issue might be, otherwise head back and we can try again.

    http://stackoverflow.com/questions/1...ension-threw-a
    These are all a little confusing to me, but I will try to look into it.

  6. #6

    Thread Starter
    New Member
    Join Date
    Oct 2014
    Posts
    13

    Re: Error setting background image in WPF using Visual Basic, Visual Basic Studio

    Weird - I got it to work. Before debugging, only placing "space.jpg" in xaml would load the image, but for whatever reason, gave me the crash....once I put the whole file location into xaml...it worked!

    "file:///c:/users/pikey10/documents/visual studio 2013/Projects/Mission Control B/Mission Control B/space.jpg"

    as opposed to "space.jpg" Even though it still loaded and everything before debugging...

  7. #7
    Addicted Member
    Join Date
    Jan 2010
    Posts
    250

    Re: Error setting background image in WPF using Visual Basic, Visual Basic Studio

    glad to hear it worked...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width