How to specify relative path to resource file in sVB .xaml file?

Absolute Beginner 171 Reputation points
2022-11-29T09:42:43.383+00:00

(translated by Google translator)

Please tell me how to specify in sVB .xaml file relative path to image file that I want to make the background for the form?
Right now, I know how specify only an absolute path in the Form Editor. If I move the project folder, then the absolute path doesn't work.

Thanks.

Small BASIC
Small BASIC
A programming language created by Microsoft that serves a stepping stone for beginners from block-based coding languages to more complex text-based languages.
277 questions
0 comments No comments
{count} votes

Accepted answer
  1. Small Visual Basic 411 Reputation points
    2022-11-30T22:26:26.947+00:00

    I created the ultimate fix for this. Now you can use the designer to create an image brush for the form and controls backgrounds, foregrounds and even borders, and sVB will copy the image to the project flder, and save its relative path. The Save As commands no copy images with .sb and .xaml files to the new destination.
    Please download the latest update of sVB v2.6.8

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. WhTurner 1,611 Reputation points
    2022-11-29T12:12:52.867+00:00

    You can just as in SmallBasic use as the start of the filename "Program.Directory" which is the directory in which your program runs.
    You can alwways point to another directory relative to the current one, e.g. with Program.Directory/.. to use the parent directory.


  2. WhTurner 1,611 Reputation points
    2022-11-29T12:22:50.36+00:00

    How and why do you want me to talk to you?

    0 comments No comments