Skip to main content

Microsoft Silverlight

Answered Question Border's heigh and image's height problemsRSS Feed

(0)

shintaro
shintaro

Member

Member

1 points

2 Posts

Border's heigh and image's height problems

i have a problem with object image and border, the image's height isn't same than the border. All my borders have the same height, which is the height of the bigger image.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
foreach (Donnee d in mDos.mesImages)
            {
                if (columnCourante == 0)
                {
                    RowDefinition rowDef1 = new RowDefinition();
                    imageGrid.RowDefinitions.Add(rowDef1);
                    rowCourante++;
                }
                columnCourante++;
 
                monImage1 = new Image() { Source = new BitmapImage(new Uri(dossierImage + d.nom, UriKind.Relative)),Width=100, Opacity=100  };
                monImage = new ImageBrush() { ImageSource = new BitmapImage(new Uri(dossierImage + d.nom, UriKind.Relative)) };
 
                maBorder1 = new Border()
                {
                    Background = monImage,
                    Child=monImage1,
                    BorderBrush = new SolidColorBrush(Colors.Black),
                    Margin = new Thickness(20, 20, 20, 20),
                    CornerRadius = new CornerRadius(10),
                    BorderThickness = new Thickness(1.0),
                };
 
                monImage1.MouseLeftButtonDown += new MouseButtonEventHandler(monImage1_MouseLeftButtonDown);
                imageGrid.Children.Add(maBorder1);
                Grid.SetColumn(maBorder1, columnCourante);
                Grid.SetRow(maBorder1, rowCourante - 1);
                if (columnCourante == 5)
                {
                    columnCourante = 0;
                }
 
 
            }

Help me please

microsoft_kc
microsof...

Contributor

Contributor

2890 points

564 Posts

Re: Border's heigh and image's height problems

So, what you want? Can you explain your problem?

Remember: Please click on "Mark As Answer", if this answered your query partially or fully.


Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog

SharpGIS
SharpGIS

Contributor

Contributor

3387 points

611 Posts

Answered Question

Re: Border's heigh and image's height problems

Set Horizontal- and VerticalAlignment on the border to prevent it from scaling to the size of the parent container. It defaults to stretch.

--
/Morten | blog - twitter
Please click on "Mark as Answer" if this answered your question.

shintaro
shintaro

Member

Member

1 points

2 Posts

Re: Re: Border's heigh and image's height problems

 Thanks SharpGIS, my problem resolved with your solution.

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities