2010-06-03 6 views

Répondre

0

Avoir un StackPanel avec 1 image, puis une zone de texte, puis une autre image

<StackPanel Height="100" HorizontalAlignment="Left" Margin="26,164,0,0" Name="stackPanel1" VerticalAlignment="Top" Width="200"> 
    <Image Height="150" Name="image2" Source="Peter-Gfader-head.png" Stretch="Fill" Width="200" /> 
    <TextBox Height="23" Name="textBox2" Text="{Binding MessageFromDataBase}" Width="120" /> 
    <Image Height="150" Name="image1" Source="Peter.png" Stretch="Fill" Width="200" /> 
</StackPanel> 
1

Une façon de le faire est de mettre un place Textblock de votre zone de texte {espérant ici que vous ne cherchez pas l'entrée d'utilisateur} , définissez sa propriété TextWrapping à Wrap.

Important de ne pas attribuer de valeur à la propriété height du bloc de texte.

Exemple de code:

 <ScrollViewer VerticalScrollBarVisibility="Auto"> 
     <StackPanel HorizontalAlignment="Left" Name="stackPanel1" VerticalAlignment="Top" Width="200" Orientation="Vertical"> 
      <Image Height="150" Name="image2" Source="arrow.png" Stretch="Fill" Width="200" /> 
      <TextBlock Name="textBox2" Width="200" TextWrapping="Wrap" LineStackingStrategy="MaxHeight" Text="The trouble with a lot of software development today I think lies with an incomplete understanding of what Software Development really is, or what kind of work relates to it. Most people in the general populace have very little understanding of software, and tend to concentrate on the layer they can see, which is understandable, the UI; while the UI is very important, most of the work lies beneath. Managers of programmers meanwhile, tend to see them as engineers and some even take the title, Software Engineer. In many cases this title is accurate: building mission critical applications that manage money, space shuttles, or medical equipment are very engineer-oriented work that require attention to detail and much left-brain thinking. However, a lot of Software Development can afford to be more “experimental,” like how GMail was notoriously in beta for years. Without that experimental nature, we wouldn’t have a lot of the great software we have today. 

So if software development isn’t engineering, what is it? Science? Yes, partly. Science implies making a hypothesis and testing it. Every method that is tested could be considered a hypothesis. In most software projects there are teams of Testers who are confirming the hypothesis “the software works as intended” and there are reams of documentation about what “works as intended” means. But when it comes to the UI (or Human-Computer-Interface), it is difficult to test and design becomes a mix of Art and Science. Testing is great, but without creativity, how would you ever devise your interface to begin with? 

Since the beginning of software history, some User-Interface has existed and they have become progressively more beautiful and interactive over time. We’ve gone from the Lisa to the iPad. As the hardware has improved, so has our ability to create more complex interactive interfaces. Art doesn’t stop at the UI either. Programmers are humans too, so I would argue that Art permeates every level of Software Development. That’s why coders often say (or think) “this code is ugly”, “that language is beautiful.” 

Some argue that all software developers should practice engineering, regardless of what happens today, but without Art and Science, software development would be lacking. Would you say Frank Lloyd Wright only practiced engineering?"/> 
      <Image Height="150" Name="image1" Source="arrow.png" Stretch="Fill" Width="200" /> 
     </StackPanel> 
      </ScrollViewer> 
</Grid> 

J'ai utilisé un ScrollViewer donc je peux faire défiler pour afficher le contenu.

J'espère que cela vous aide.

Questions connexes