2016-08-18 11 views
0

vb.net wpfの問題に直面しています。 私はあなたがいくつかのアイデアを寄付することができる場所にあるツールで寄付ページのようなことをしたいと思います。また、あなたは寄付のアイデアを評価できるはずです。だから私は評価を示す星を作った。画像が最下部に配置されると画像が上から切れる

問題は、星の最初の2行が正しく表示されていることです。しかし、第3のものは上から消えていきます。

The Stars are actually there

But seem to get cut off from the top

もちろん私達はちょうど私たちの空き時間でこれを行うと、私たち自身でこれを学ぼう(私たちが使用するコードを参照してください。therefroeこのコードはおそらくであることを気にしないでくださいあなたが今まで見た中で最高ではない - 私たちはそれは、多かれ少なかれ機能していることだけで嬉しいです):

Imports System.Windows.Forms 

Private Sub MetroWindow_Loaded(sender As Object, e As RoutedEventArgs) 
    Dim OpenDonations As Integer = 3 
    If OpenDonations <> 0 Then 
     Try 
      Dim needed As Double 
      Dim reached As Double 
      Dim Währung As String = "" 
      Dim ratings(0) As String 

      Dim i As Integer = OpenDonations 

      Dim y As Double = 10 
      Dim Z As Integer = 1 

      Do While 0 < i 

       'Set needed value from DB 
       'Set reached value from DB 
       'Set Währung value from DB 

       '[...] creating the other objects like label, scrollviewer, textblock, image(on the left), button, progressbar.. 

       'create rating pictures 

       Dim Leftstar1 As New Image() 
       Dim rightstar1 As New Image() 
       Dim Leftstar2 As New Image() 
       Dim rightstar2 As New Image() 
       Dim Leftstar3 As New Image() 
       Dim rightstar3 As New Image() 
       Dim Leftstar4 As New Image() 
       Dim rightstar4 As New Image() 
       Dim Leftstar5 As New Image() 
       Dim rightstar5 As New Image() 

       Leftstar1.Name = "StarImageLeft1" + Z.ToString 
       rightstar1.Name = "StarImageright1" + Z.ToString 
       Leftstar2.Name = "StarImageLeft2" + Z.ToString 
       rightstar2.Name = "StarImageright2" + Z.ToString 
       Leftstar3.Name = "StarImageLeft3" + Z.ToString 
       rightstar3.Name = "StarImageright3" + Z.ToString 
       Leftstar4.Name = "StarImageLeft4" + Z.ToString 
       rightstar4.Name = "StarImageright4" + Z.ToString 
       Leftstar5.Name = "StarImageLeft5" + Z.ToString 
       rightstar5.Name = "StarImageright5" + Z.ToString 

       Dim Bewertung As Double = 'get value from db 

       Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Relative)) 
       rightstar1.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative)) 
       Leftstar2.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Relative)) 
       rightstar2.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative)) 
       Leftstar3.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Relative)) 
       rightstar3.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative)) 
       Leftstar4.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Relative)) 
       rightstar4.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative)) 
       Leftstar5.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Relative)) 
       rightstar5.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative)) 

       If Bewertung = 0 Then 

       ElseIf Bewertung <= 0.5 Then 
        Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
       ElseIf Bewertung <= 1 Then 
        Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar1.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
       ElseIf Bewertung <= 1.5 Then 
        Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar1.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar2.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
       ElseIf Bewertung <= 2 Then 
        Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar1.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar2.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar2.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
       ElseIf Bewertung <= 2.5 Then 
        Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar1.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar2.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar2.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar3.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
       ElseIf Bewertung <= 3 Then 
        Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar1.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar2.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar2.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar3.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar3.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
       ElseIf Bewertung <= 3.5 Then 
        Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar1.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar2.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar2.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar3.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar3.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar4.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
       ElseIf Bewertung <= 4 Then 
        Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar1.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar2.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar2.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar3.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar3.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar4.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar4.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
       ElseIf Bewertung <= 4.5 Then 
        Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar1.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar2.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar2.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar3.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar3.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar4.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar4.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar5.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
       ElseIf Bewertung <= 5 Then 
        Leftstar1.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar1.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar2.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar2.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar3.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar3.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar4.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar4.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
        Leftstar5.Source = New BitmapImage(New Uri(leftstarsource_full, UriKind.Relative)) 
        rightstar5.Source = New BitmapImage(New Uri(rightstarsource_full, UriKind.Relative)) 
       End If 

       Leftstar1.HorizontalAlignment = Windows.HorizontalAlignment.Left 
       Leftstar1.VerticalAlignment = Windows.VerticalAlignment.Top 
       Leftstar1.Height = 25 
       Leftstar1.Width = 25 
       'Leftstar1.Margin = New Thickness(x, y + 110 + Progressbar_reached.Height + 10, 0, 0) 
       Leftstar1.Margin = New Thickness(x + 200, Z * 125, 0, 0) 

       rightstar1.HorizontalAlignment = Windows.HorizontalAlignment.Left 
       rightstar1.VerticalAlignment = Windows.VerticalAlignment.Top 
       rightstar1.Height = 25 
       rightstar1.Width = 25 
       rightstar1.Margin = New Thickness(Leftstar1.Margin.Left + 13, Leftstar1.Margin.Top, 0, 0) 

       Leftstar2.HorizontalAlignment = Windows.HorizontalAlignment.Left 
       Leftstar2.VerticalAlignment = Windows.VerticalAlignment.Top 
       Leftstar2.Height = 25 
       Leftstar2.Width = 25 
       Leftstar2.Margin = New Thickness(rightstar1.Margin.Left + 10, Leftstar1.Margin.Top, 0, 0) 
       rightstar2.HorizontalAlignment = Windows.HorizontalAlignment.Left 
       rightstar2.VerticalAlignment = Windows.VerticalAlignment.Top 
       rightstar2.Height = 25 
       rightstar2.Width = 25 
       rightstar2.Margin = New Thickness(Leftstar2.Margin.Left + 13, Leftstar1.Margin.Top, 0, 0) 

       Leftstar3.HorizontalAlignment = Windows.HorizontalAlignment.Left 
       Leftstar3.VerticalAlignment = Windows.VerticalAlignment.Top 
       Leftstar3.Height = 25 
       Leftstar3.Width = 25 
       Leftstar3.Margin = New Thickness(rightstar2.Margin.Left + 10, Leftstar1.Margin.Top, 0, 0) 
       rightstar3.HorizontalAlignment = Windows.HorizontalAlignment.Left 
       rightstar3.VerticalAlignment = Windows.VerticalAlignment.Top 
       rightstar3.Height = 25 
       rightstar3.Width = 25 
       rightstar3.Margin = New Thickness(Leftstar3.Margin.Left + 13, Leftstar1.Margin.Top, 0, 0) 

       Leftstar4.HorizontalAlignment = Windows.HorizontalAlignment.Left 
       Leftstar4.VerticalAlignment = Windows.VerticalAlignment.Top 
       Leftstar4.Height = 25 
       Leftstar4.Width = 25 
       Leftstar4.Margin = New Thickness(rightstar3.Margin.Left + 10, Leftstar1.Margin.Top, 0, 0) 
       rightstar4.HorizontalAlignment = Windows.HorizontalAlignment.Left 
       rightstar4.VerticalAlignment = Windows.VerticalAlignment.Top 
       rightstar4.Height = 25 
       rightstar4.Width = 25 
       rightstar4.Margin = New Thickness(Leftstar4.Margin.Left + 13, Leftstar1.Margin.Top, 0, 0) 

       Leftstar5.HorizontalAlignment = Windows.HorizontalAlignment.Left 
       Leftstar5.VerticalAlignment = Windows.VerticalAlignment.Top 
       Leftstar5.Height = 25 
       Leftstar5.Width = 25 
       Leftstar5.Margin = New Thickness(rightstar4.Margin.Left + 10, Leftstar1.Margin.Top, 0, 0) 
       rightstar5.HorizontalAlignment = Windows.HorizontalAlignment.Left 
       rightstar5.VerticalAlignment = Windows.VerticalAlignment.Top 
       rightstar5.Height = 25 
       rightstar5.Width = 25 
       rightstar5.Margin = New Thickness(Leftstar5.Margin.Left + 13, Leftstar1.Margin.Top, 0, 0) 


       '[...] here is actually some code for mouseover and mouselevave events of the starimages but had to be shortended so everything fits. 

       Me.GridDonations.Children.Add(Leftstar1) 
       Me.GridDonations.Children.Add(rightstar1) 
       Me.GridDonations.Children.Add(Leftstar2) 
       Me.GridDonations.Children.Add(rightstar2) 
       Me.GridDonations.Children.Add(Leftstar3) 
       Me.GridDonations.Children.Add(rightstar3) 
       Me.GridDonations.Children.Add(Leftstar4) 
       Me.GridDonations.Children.Add(rightstar4) 
       Me.GridDonations.Children.Add(Leftstar5) 
       Me.GridDonations.Children.Add(rightstar5) 




       y = y + 10 + 100 + 10 + Progressbar_reached.Height + 10 + Leftstar1.Height + 15 
       i = i - 1 

       If Z <> 1 Then 
        Me.Height = Me.Height + Image.Height + 10 + Progressbar_reached.Height + 10 + 10 + Leftstar1.Height + 15 
       Else 
        Me.Height = 30 + 10 + Image.Height + 10 + Progressbar_reached.Height + 10 + 10 + Leftstar1.Height + 15 
       End If 

       Z += 1 

      Loop 
     Catch 
     End Try 
    Else 
     Dim NoDonations_Label As New System.Windows.Controls.Label() 
     NoDonations_Label.Name = "NoDonationLabel" 
     NoDonations_Label.Content = "No Donations needed!" 
     Me.GridDonations.Children.Add(NoDonations_Label) 

    End If 

End Sub 

私が追加したとき、私は最初から再びそれを実行しようとしましたし、星はすでに消えてかどうかを知りたいと思いましたそれら.. Unfor彼らは調整する。 ここで私は、この時間を使用するコードです:

Imports System.Windows.Forms 

Public Class Donations 
    Dim funktionen As New Methoden 
    Dim leftstarsource_empty As String = "/LiquidMustard;component/pics/leftstar_empty.png" 
    Dim rightstarsource_empty As String = "/LiquidMustard;component/pics/rightstar_empty.png" 
    Dim leftstarsource_full As String = "/LiquidMustard;component/pics/leftstar_full.png" 
    Dim rightstarsource_full As String = "/LiquidMustard;component/pics/rightstar_full.png" 
    Private Sub MetroWindow_Loaded(sender As Object, e As RoutedEventArgs) 
     Dim OpenDonations As Integer = funktionen.getvaluebyquery("Select Count(*) from lm_donations") 

    'Neues Grid anlegen 
    Dim DonationGrid As New Grid() 
    DonationGrid.Name = "DonationGrid" 
    DonationGrid.VerticalAlignment = Windows.VerticalAlignment.Top 
    DonationGrid.HorizontalAlignment = Windows.HorizontalAlignment.Left 
    DonationGrid.Margin = New Thickness(0) 

    Try 
     Dim needed As Double 
     Dim reached As Double 
     Dim Währung As String = "" 
     Dim heightvalue As Integer = 10 

     Dim i As Integer = 1 

     Do While 0 < OpenDonations 

      needed = funktionen.getvaluebyquery("Select needed from lm_donations where DonationName = 'Donation" & i & "'") 
      reached = funktionen.getvaluebyquery("Select reached_confirmed from lm_donations where DonationName = 'Donation" & i & "'") 
      Währung = funktionen.getvaluebyquery("Select Währung from lm_donations where DonationName = 'Donation" & i & "'") 

      Dim Starimage_left_1 As New Image() 
      Dim Starimage_left_2 As New Image() 
      Dim Starimage_left_3 As New Image() 
      Dim Starimage_left_4 As New Image() 
      Dim Starimage_left_5 As New Image() 
      Dim Starimage_right_1 As New Image() 
      Dim Starimage_right_2 As New Image() 
      Dim Starimage_right_3 As New Image() 
      Dim Starimage_right_4 As New Image() 
      Dim Starimage_right_5 As New Image() 

      Starimage_left_1.Name = "Starimage_left_1" & i.ToString 
      Starimage_left_2.Name = "Starimage_left_2" & i.ToString 
      Starimage_left_3.Name = "Starimage_left_3" & i.ToString 
      Starimage_left_4.Name = "Starimage_left_4" & i.ToString 
      Starimage_left_5.Name = "Starimage_left_5" & i.ToString 
      Starimage_right_1.Name = "Starimage_right_1" & i.ToString 
      Starimage_right_2.Name = "Starimage_right_2" & i.ToString 
      Starimage_right_3.Name = "Starimage_right_3" & i.ToString 
      Starimage_right_4.Name = "Starimage_right_4" & i.ToString 
      Starimage_right_5.Name = "Starimage_right_5" & i.ToString 

      Starimage_left_1.Margin = New Thickness(10, heightvalue, 0, 0) 
      Starimage_right_1.Margin = New Thickness(Starimage_left_1.Margin.Left + 13, Starimage_left_1.Margin.Top, 0, 0) 

      Starimage_left_2.Margin = New Thickness(Starimage_right_1.Margin.Left + 13, Starimage_left_1.Margin.Top, 0, 0) 
      Starimage_right_2.Margin = New Thickness(Starimage_left_2.Margin.Left + 13, Starimage_left_1.Margin.Top, 0, 0) 

      Starimage_left_3.Margin = New Thickness(Starimage_right_2.Margin.Left + 13, Starimage_left_1.Margin.Top, 0, 0) 
      Starimage_right_3.Margin = New Thickness(Starimage_left_3.Margin.Left + 13, Starimage_left_1.Margin.Top, 0, 0) 

      Starimage_left_4.Margin = New Thickness(Starimage_right_3.Margin.Left + 13, Starimage_left_1.Margin.Top, 0, 0) 
      Starimage_right_4.Margin = New Thickness(Starimage_left_4.Margin.Left + 13, Starimage_left_1.Margin.Top, 0, 0) 

      Starimage_left_5.Margin = New Thickness(Starimage_right_4.Margin.Left + 13, Starimage_left_1.Margin.Top, 0, 0) 
      Starimage_right_5.Margin = New Thickness(Starimage_left_5.Margin.Left + 13, Starimage_left_1.Margin.Top, 0, 0) 


      Starimage_left_1.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Absolute)) 
      Starimage_right_1.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative)) 
      Starimage_left_2.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Relative)) 
      Starimage_right_2.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative)) 
      Starimage_left_3.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Relative)) 
      Starimage_right_3.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative)) 
      Starimage_left_4.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Relative)) 
      Starimage_right_4.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative)) 
      Starimage_left_5.Source = New BitmapImage(New Uri(leftstarsource_empty, UriKind.Relative)) 
      Starimage_right_5.Source = New BitmapImage(New Uri(rightstarsource_empty, UriKind.Relative)) 

      Starimage_left_1.Height = 25 
      Starimage_left_1.Width = 25 
      Starimage_left_2.Height = 25 
      Starimage_left_2.Width = 25 
      Starimage_left_3.Height = 25 
      Starimage_left_3.Width = 25 
      Starimage_left_4.Height = 25 
      Starimage_left_4.Width = 25 
      Starimage_left_5.Height = 25 
      Starimage_left_5.Width = 25 
      Starimage_right_1.Height = 25 
      Starimage_right_1.Width = 25 
      Starimage_right_2.Height = 25 
      Starimage_right_2.Width = 25 
      Starimage_right_3.Height = 25 
      Starimage_right_3.Width = 25 
      Starimage_right_4.Height = 25 
      Starimage_right_4.Width = 25 
      Starimage_right_5.Height = 25 
      Starimage_right_5.Width = 25 

      Starimage_left_1.HorizontalAlignment = Windows.HorizontalAlignment.Left 
      Starimage_left_2.HorizontalAlignment = Windows.HorizontalAlignment.Left 
      Starimage_left_3.HorizontalAlignment = Windows.HorizontalAlignment.Left 
      Starimage_left_4.HorizontalAlignment = Windows.HorizontalAlignment.Left 
      Starimage_left_5.HorizontalAlignment = Windows.HorizontalAlignment.Left 
      Starimage_right_1.HorizontalAlignment = Windows.HorizontalAlignment.Left 
      Starimage_right_2.HorizontalAlignment = Windows.HorizontalAlignment.Left 
      Starimage_right_3.HorizontalAlignment = Windows.HorizontalAlignment.Left 
      Starimage_right_4.HorizontalAlignment = Windows.HorizontalAlignment.Left 
      Starimage_right_5.HorizontalAlignment = Windows.HorizontalAlignment.Left 

      Starimage_left_1.VerticalAlignment = Windows.VerticalAlignment.Top 
      Starimage_left_2.VerticalAlignment = Windows.VerticalAlignment.Top 
      Starimage_left_3.VerticalAlignment = Windows.VerticalAlignment.Top 
      Starimage_left_4.VerticalAlignment = Windows.VerticalAlignment.Top 
      Starimage_left_5.VerticalAlignment = Windows.VerticalAlignment.Top 
      Starimage_right_1.VerticalAlignment = Windows.VerticalAlignment.Top 
      Starimage_right_2.VerticalAlignment = Windows.VerticalAlignment.Top 
      Starimage_right_3.VerticalAlignment = Windows.VerticalAlignment.Top 
      Starimage_right_4.VerticalAlignment = Windows.VerticalAlignment.Top 
      Starimage_right_5.VerticalAlignment = Windows.VerticalAlignment.Top 

      DonationGrid.Children.Add(Starimage_left_1) 
      DonationGrid.Children.Add(Starimage_left_2) 
      DonationGrid.Children.Add(Starimage_left_3) 
      DonationGrid.Children.Add(Starimage_left_4) 
      DonationGrid.Children.Add(Starimage_left_5) 
      DonationGrid.Children.Add(Starimage_right_1) 
      DonationGrid.Children.Add(Starimage_right_2) 
      DonationGrid.Children.Add(Starimage_right_3) 
      DonationGrid.Children.Add(Starimage_right_4) 
      DonationGrid.Children.Add(Starimage_right_5) 

      Me.Height = Starimage_left_1.Margin.Top + 26 + 25 + 10 
      DonationGrid.Height = Me.Height + 200 

      OpenDonations -= 1 
      i += 1 
      heightvalue += 205 

     Loop 

     Me.AddChild(DonationGrid) 

    Catch 
    End Try 

End Sub 
End Class 

が、これはウィンドウのXAMLです:

<Controls:MetroWindow x:Class="Donations" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" 
Title="Donations" Icon="/LiquidMustard;component/pics/Mustard.ico" WindowStyle="SingleBorderWindow" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" ResizeMode="NoResize" ShowInTaskbar="False" Height="210.596" Width="510" Loaded="MetroWindow_Loaded"> 
<Window.Resources> 
    <ResourceDictionary> 
     <ResourceDictionary.MergedDictionaries> 
      <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colours.xaml" /> 
      <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" /> 
      <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" /> 
      <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" /> 
      <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" /> 
      <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedTabControl.xaml" /> 
      <ResourceDictionary Source="Liquidstyle.xaml" /> 
     </ResourceDictionary.MergedDictionaries> 
    </ResourceDictionary> 
</Window.Resources> 
<Controls:MetroWindow.WindowCommands> 
    <Controls:WindowCommands/> 
</Controls:MetroWindow.WindowCommands> 

+1

コードに 'Z'とは何ですか? –

+0

zは1から始まりループ内でカウントアップする単なる整数です。 私が作成しているさまざまなオブジェクトに一意の名前を付けるために使用します。さらに、最初のループを識別してウィンドウのサイズを正しく取得するために使用します。コードではマージンにも使用されます。これは星が消える場所をテストするためのものです。 –

答えて

0

私はこの問題を解決しました。 新しい写真を作成して使用しました。 古い星像がなぜうまくいかなかったのか分かりませんが、新しい星座は期待通りに動作しています。

関連する問題