J'utilise un contrôle d'en-tête dans l'application wpf en ce que j'utilise Grid et dans cette grille, je mets la boîte liste des boutons et zone de texte. Je veux faire défiler cette boîte de texte. Pouvez-vous s'il vous plaît me donner la solutionComment faire défilement TextBox dans WPF
1
A
Répondre
5
Pour une zone de texte définir ses propriétés suivantes:
<TextBox AcceptsReturn="True"
VerticalScrollBarVisibility="Auto"/>
Vous avez dit:
I have tried this but it is not working <Label Content="Log Details" Grid.Row="4" ></Label> <Border Margin="7,7,7,3" Grid.Row="5"> <ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="5" > <StackPanel > <TextBox Margin="5" AcceptsReturn="True" VerticalScrollBarVisibility="Visible" IsReadOnly="True" x:Name="LogDetails"></TextBox> </StackPanel> </ScrollViewer> </Border> I am putting this in headercontrol. – jolly
En fait, vous n » Il est nécessaire de placer un TextBox dans un ScrollViewer puisque TextBox a déjà un ScrollViewer associé dans son Template. Mais si vous avez votre exigence spécifique dans lequel vous devez faire la même chose, vous pouvez essayer quelque chose comme ceci:
<Label Content="Log Details" Grid.Row="4" ></Label>
<Border Margin="7,7,7,3" Grid.Row="5">
<ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="5" >
<StackPanel>
<TextBox Margin="5" TextWrapping="Wrap" AcceptsReturn="True" IsReadOnly="True" x:Name="LogDetails"></TextBox>
</StackPanel>
</ScrollViewer>
</Border>
2
essayer:
<ScrollViewer>
<Textbox/>
</ScrollViewer>
Questions connexes
- 1. textbox - textbinding dans WPF
- 2. WPF: incorporation de TextBox dans TextBox
- 3. Comment désactiver les raccourcis dans WPF TextBox
- 4. Comment simuler coller dans un TextBox WPF?
- 5. Comment faire Textbox Envoyer
- 6. WPF Custom TextBox
- 7. WPF: TextBox redimensionne l'intérieur ScrollViewer
- 8. Comment faire un TextBox autocomplete dans ASP.NET?
- 9. vertical Aligner WPF TextBox
- 10. WPF Étiquette à textBox
- 11. Comment faire pour obtenir ComboBox.SelectedText dans WPF
- 12. WPF StringCollection + TextBox
- 13. WPF: TextBox avec ProgressBar
- 14. WPF TextBox Overwrite
- 15. WPF TextBox avec Label
- 16. Comment faire pour faire pivoter un TextBox dans Microsoft Report?
- 17. Hiding barre de défilement verticale dans TextBox multiligne dans IE
- 18. wpf dataagrid textbox + combobox
- 19. Comment faire pour savoir quel caractère est supprimé dans TextBox dans WPF?
- 20. WPF - Afficher Textbox infobulle
- 21. wpf textbox textwrapping
- 22. WPF TextBox autogrow
- 23. Set accent sur textbox dans WPF
- 24. faire textbox extensible
- 25. Stylisation d'un TextBox avec IDataErrorInfo dans WPF
- 26. Comment faire un défilement dans jQuery?
- 27. wpf, comment limiter MaxLength de TextBox?
- 28. WPF barre de défilement
- 29. WPF TextBox Mise au point
- 30. WPF TextBox TextProperty métadonnées override
J'ai essayé, mais il ne fonctionne pas ScrollViewer> Je mets ceci dans la commande de phare. –
jolly