textbox 相关问题

文本框是一个图形用户界面元素,它允许简单的输入文本,通常只有一行文本。

为什么无法在文本框中插入小数?

这是我的视图模型: 公共类 ViewModelData :INotifyPropertyChanged { 私有小数?我的价值; 公共十进制?我的价值 { 获取 { 返回 myValue; } 放 { ...

回答 1 投票 0

用于在 Excel 工作簿中取消形状(特别是文本框)分组的宏

我有一个宏,用于翻译 Excel 工作簿中文本框形状内的文本,但如果任何文本框分组在任何工作表中,则该宏会失败。有没有一种简单的方法可以取消

回答 1 投票 0

Wpf 问题:带有样式的文本框不会在文本框中获取值。 (它总是空字符串)

我是wpf编程新手。当我点击按钮时。它应该向我显示文本框中的消息。但是,它仅显示一个空字符串。我的文本框使用名为“

回答 1 投票 0

如何在tkinter中制作闪烁的文本框?

所以我的计算课正在用Python制作一张圣诞卡,其中一个位将有一个带有消息的文本框,但如何使背景从绿色和红色交替? 如果

回答 2 投票 0

为什么我的自动完成文本框事件 TextChanged 在 VB.NET 中运行得这么慢

我正在尝试使用文本框事件 TextChanged 自动完成,但使用 VB.NET 运行速度很慢。 虽然只有6条记录,我的代码有问题吗,请指导我。 我附上了一份gi...

回答 1 投票 0

如何用VB.NET改变文本框类中图标的位置

我正在尝试使用 VB.NET 更改文本框类中图标的位置 也许我的代码不合适,请指导我。 请指导我。 谢谢 下面的代码在vb.net中 公开课搜索文本...

回答 1 投票 0

如何在 HTML/Javascript 中制作自定义的项目符号文本框?

我正在尝试用 HTML/Javascript 制作一个自定义文本框,并满足以下要求: 文本框的初始状态将是单个项目符号点,如下所示: 每行必须以项目符号开头...

回答 1 投票 0

使用 VBA(Excel 宏)将文本框内容从西班牙语翻译和替换为英语

我希望尽可能高效地翻译 Excel 工作簿文件,其中包含单元格中的某些内容和放置在每个工作表中的文本框对象中的其他内容。我找到了一些很好的例子...

回答 1 投票 0

使用python在excel上插入Texbox

我需要使用python在Excel工作表中插入一个文本框,我已经尝试过openpyxl,更具体地说是openpyxl.drawing.shape,xlsxwriter等,但它不起作用。 从 openpyxl 导入 Workboo...

回答 1 投票 0

如何编写文本框中鼠标滚动时发生的事件?

我想更改鼠标滚动时文本框的数量。我有一个滚动文本框,但我不想使用它。有与此相关的活动吗? 我应该编写一个文本框事件吗?如果是的话,如何...

回答 4 投票 0

如何从 WinForms 中的 TextBox 中移除焦点?

我需要从几个文本框中删除焦点。我尝试使用: textBox1.Focused = false; 它的 ReadOnly 属性值为 true。 然后我尝试将焦点设置在表单上,以便将其删除......

回答 21 投票 0

WPF圆角文本框

我不懂WPF,现在正在学习。我正在寻找 WPF 中的圆角 TextBox。所以我搜索了Google并找到了一段XAML: 我不了解WPF,现在正在学习。我在 WPF 中寻找圆角TextBox。所以我在Google上搜索并找到了一块XAML: <!–Rounded Corner TextBoxes–> <ControlTemplate x:Key=”RoundTxtBoxBaseControlTemplate” TargetType=”{x:Type Control}”> <Border Background=”{TemplateBinding Background}” x:Name=”Bd” BorderBrush=”{TemplateBinding BorderBrush}” BorderThickness=”{TemplateBinding BorderThickness}” CornerRadius=”6″> <ScrollViewer x:Name=”PART_ContentHost”/> </Border> <ControlTemplate.Triggers> <Trigger Property=”IsEnabled” Value=”False”> <Setter Property=”Background” Value=”{DynamicResource {x:Static SystemColors.ControlBrushKey}}” TargetName=”Bd”/> <Setter Property=”Foreground” Value=”{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}”/> </Trigger> <Trigger Property=”Width” Value=”Auto”> <Setter Property=”MinWidth” Value=”100″/> </Trigger> <Trigger Property=”Height” Value=”Auto”> <Setter Property=”MinHeight” Value=”20″/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> 所以请告诉我将其粘贴到哪里XAML。请详细帮助我。我是 WPF 的初学者。 @Smolla 在对 @Daniel Casserly 的回答的评论中给出了更好的答案: <TextBox Text="TextBox with CornerRadius"> <TextBox.Resources> <Style TargetType="{x:Type Border}"> <Setter Property="CornerRadius" Value="3"/> </Style> </TextBox.Resources> </TextBox> 如果您希望 TextBox 和 ListBox 的所有边框都有圆角,请将样式放入您的 Window 或 App 中<Resources>。 在 WPF 中,您可以修改或重新创建控件的外观。因此,如果您的示例他们所做的是通过修改现有 ControlTemplate 的 TextBox 来更改文本框的外观。因此,要查看和探索这段代码,只需使用下面的代码 <Window x:Class="WpfApplication4.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Window.Resources> <ControlTemplate x:Key="TextBoxBaseControlTemplate" TargetType="{x:Type TextBoxBase}"> <Border Background="{TemplateBinding Background}" x:Name="Bd" BorderBrush="Black" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="10"> <ScrollViewer x:Name="PART_ContentHost"/> </Border> <ControlTemplate.Triggers> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" TargetName="Bd"/> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> </Trigger> <Trigger Property="Width" Value="Auto"> <Setter Property="MinWidth" Value="100"/> </Trigger> <Trigger Property="Height" Value="Auto"> <Setter Property="MinHeight" Value="20"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Window.Resources> <Grid> <TextBox Template="{StaticResource TextBoxBaseControlTemplate}" Height="25" Margin="5"></TextBox> </Grid> 因此,我们在窗口的资源部分声明了一个静态资源,并在 Template 的 TextBox 属性中使用了 Resource TextBoxBaseControlTemplate 作为 Template="{StaticResource TextBoxBaseControlTemplate}" 。 自定义 WPF 控件的模板只需参考此文档即可获得想法 http://msdn.microsoft.com/en-us/magazine/cc163497.aspx 您可以使用以下样式将所有文本框更改为圆角: <Style TargetType="{x:Type TextBox}"> <Style.Resources> <Style TargetType="{x:Type Border}"> <Setter Property="CornerRadius" Value="3" /> </Style> </Style.Resources> </Style> 受到以下答案的启发:https://stackoverflow.com/a/13858357/3387453 只需将文本框的 BorderThickness 设置为零即可在文本框周围添加边框。 <Border BorderThickness="1" BorderBrush="Black" CornerRadius="10" Padding="2" HorizontalAlignment="Center" VerticalAlignment="Center"> <TextBox Text="Hello ! " BorderThickness="0"/> </Border> 输出如图所示! 这个问题在 msdn 上得到了很好的讨论: http://social.msdn.microsoft.com/forums/en-US/wpf/thread/549775ed-1c2a-4911-9078-d9c724294fb3/ 尝试那里的解决方案,它们非常详细,并且足够详细,让您知道将代码放在哪里。 您可以使用附加属性来设置TextBox边框半径(同样适用于按钮)。 为附加属性创建类 public class CornerRadiusSetter { public static CornerRadius GetCornerRadius(DependencyObject obj) => (CornerRadius)obj.GetValue(CornerRadiusProperty); public static void SetCornerRadius(DependencyObject obj, CornerRadius value) => obj.SetValue(CornerRadiusProperty, value); public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.RegisterAttached(nameof(Border.CornerRadius), typeof(CornerRadius), typeof(CornerRadiusSetter), new UIPropertyMetadata(new CornerRadius(), CornerRadiusChangedCallback)); public static void CornerRadiusChangedCallback(object sender, DependencyPropertyChangedEventArgs e) { Control control = sender as Control; if (control == null) return; control.Loaded -= Control_Loaded; control.Loaded += Control_Loaded; } private static void Control_Loaded(object sender, EventArgs e) { Control control = sender as Control; if (control == null || control.Template == null) return; control.ApplyTemplate(); Border border = control.Template.FindName("border", control) as Border; if (border == null) return; border.CornerRadius = GetCornerRadius(control); } } 然后您可以使用附加属性语法来设置多个文本框的样式,而无需重复样式: <TextBox local:CornerRadiusSetter.CornerRadius="10" /> <TextBox local:CornerRadiusSetter.CornerRadius="5, 0, 0, 5" /> <TextBox local:CornerRadiusSetter.CornerRadius="10, 4, 18, 7" /> 以困难的方式去做。 在 Visual Studio 中创建一个新的空 WPF 项目。将 TextBox 添加到主 Window。然后将鼠标放在 TextBox 上,右键单击并选择 编辑模板、编辑副本...。在出现的对话框中,选择应用于全部和此文档。 您现在拥有 TextBox 模板的副本。现在看看名称为 Border 的 border。只需添加一个 CornerRadius 即可。 接下来将此代码复制/粘贴到您的App.xaml中的/Application/Application.Resources/ResourceDictionary中。 它比其他解决方案需要更多的时间,它更复杂,但更干净,一旦你掌握了这个过程,你就可以使用 WPF 做任何你想做的事情。 这读起来很有趣。

回答 7 投票 0

WPF TextBox为所有控件设置通用的StringFormat

是否可以为项目中的所有(或部分)文本框设置 Binding 属性的 StringFormat ?是的,我可以写一些类似的东西 是否可以为项目中的所有(或部分)文本框设置 Binding 属性的 StringFormat ?是的,我可以写类似的东西 <TextBox x:Name="SetPosition" Style="{StaticResource TextBoxSmallStyle}" Text="{Binding SetPosition, Mode=TwoWay, StringFormat='{}{0:#0.0}'}" /> 但是为许多相同的文本框设置它太无聊了)))如你所见,我使用的样式包括高度,宽度等。我无法覆盖样式中的绑定属性,因为需要将此样式与任何绑定路径属性一起使用,但绑定只能完全覆盖。 哪里有解决方法? 附:我已经使用的不是标准 TextBox,而是覆盖了我的特殊功能的控件。我可以覆盖 Binding 以使用组件的代码隐藏吗? 我对在“查看”时需要“特殊”处理的属性使用(可重用)“功能”代码;例如 public string FirstName { get; set; } public string LastName { get; set; } public string FullName => this.FirstName + " " + this.LastName; ... TextBlock Text={Binding FullName} ...

回答 1 投票 0

滚动条和...文本框的奇怪问题? (垂直内容对齐)

我有这个奇怪的问题,我不明白是什么原因造成的。在我的整个项目中,文本框无法垂直居中,无论我使用什么,padding,VerticalContentAlign...

回答 1 投票 0

将旋转框绑定到文本框

我们如何获取 Spinbox 的值(从 1 到 10)然后将其乘以一个数字(例如:100)?然后将结果显示到TKINTER中的文本框中??? 我尝试了.get()方法来获取值,t...

回答 1 投票 0

将pinbox绑定到textbox

我们如何获取 Spinbox 的值(从 1 到 10)然后将其乘以一个数字(例如:100)?然后将结果显示到TKINTER中的文本框中??? 我尝试了.get()方法来获取值,t...

回答 1 投票 0

Tkinter Python - 将旋转框绑定到文本框

我们如何获取 Spinbox 的值(从 1 到 10),然后将其乘以一个数字(例如:100)。然后将结果显示到TKINTER中的文本框中??? 我尝试了 .get() 方法来获取值,...

回答 1 投票 0

Excel activex 文本框 - 无法选择输入

Office 365/Excel,我执行了以下操作: 打开新的空白工作簿.工作表 插入 activex 文本框 3) 属性 - 链接到单元格 (G1)。 但是,当退出设计模式并选择要键入的文本框时,...

回答 2 投票 0

我想在 C# 中的表单应用程序中复制项目

我想创建另外 2 个文本框,就像附图中的那样。有没有办法复制这些项目并过去,因为它们只是更改名称?或者我怎样才能创建相同的...

回答 1 投票 0

(CSS新手)文本框消失,图像变得混乱

我正在学习使用超级基本的 CSS 制作一个网页,应该如下所示: 我把班级名称写成红色 但当我输入代码时,是这样的: 我正在学习使用超级基本的 CSS 制作一个网页,应该如下所示: 但是当我输入代码时,是这样的: <!DOCTYPE html> <html lang="es-ES"> <html> <head> <title>2do parcial PROYECTO</title> <style> h1{ text-align:center; background-color:violet; border-width: 2px; } p.cul{ text-align: center; font-family: Aharoni; font-size: 35px; background-color:violet; border-style: dotted; border-width: 2px; width: 1050px; } div{ float:left; background-color: lightcyan; width: 200px; border: 15px solid red; padding: 25px; margin: 15px; } img{ float:middle; } div.one{ float:right; background-color: lightcyan; width: 330px; border: 15px solid red; padding: 25px; margin: 15px; } p{ float:left; background-color:lightcyan; width:782px; } img.one{ float:right; } p.dep{ text-align:center; font-family:Aharoni; font-size:35px; width:1050px; background-color:violet; border-style: dotted; border-width: 2px; } div.cuadrote{ float:left; position: absolute; right: %100; bottom: 800px; background-color: lightcyan; width: 200px; border: 15px solid red; padding: 25px; margin: 15px; } img.batorojo{ position: absolute; right:570px; bottom: -394px; } } div.cuadrito{ vertical-align:middle; background-color: lightcyan; border: 15px solid red; padding: 25px; margin: 15px; } img.caribe{ float:right; position: absolute; right:35px; bottom:-360px; } p.blueboxie{ background-color:lightcyan; float:left; width: 1000px; } </style> </head> <body> <h1>Evaluacion 2</h1> <p class="cul">Eventos culturales</p> <div>&#161;NUEVOS CURSOS CULTURALES EN CEART DISPONIBLES&#33;Se cuentan con clases de: *Artes plasticas(Lunes,miercoles y viernes de 5:00 a 6:30pm) *Ballet(Lunes,miercoles y viernes de 7:30 a 9:00pm) *Violin(Martes y jueves de 9:00 a 11:00am)</div> <img src="http://mexicali.org/wp-content/uploads/2012/08/Centro-Estatal-de-las-Artes.jpg" alt="x" width=300 height=200> <div class="one">Se anuncian proximamente funciones de teatrales de obras de shakespeare en el teatro del estado, entre ellas se encuentran desde clasicos como Hamlet o Romeo y Julieta hasta los escritos mas rec&oacute;nditos del autor ya mencionado.Puedes conseguir entradas en ticketmaster.com o comprarlas en la taquilla del teatro a partir del 10 de abril.Informes o dudas al (686)111-1111</div class="one"> <p>Con un festival artístico-cultural el Instituto Municipal de Arte y Cultura de Mexicali (IMACUM) conmemorará el 42 aniversario luctuoso del legendario compositor y cantante José Alfredo Jiménez. El evento tendrá lugar en las instalaciones de la Casa de la Cultura de la Juventu (CREA Cultura) este sábado 21 de noviembre, y para ello se han organizado una serie de actividades gratuitas para el goce de los mexicalenses. A las 7:00 p.m. en la Galería-Vestíbulo se inaugurará la exposición colectiva “Nomás nuestro amor”, en la que participan artistas gráficos, plásticos e ilustradores, entre ellos Gabriela Badilla, Odette Barajas, Gabriela Buenrostro, Luis Felipe Vargas Brownell, Fernando Corona, Aída Corral, Carlos Cortez, Mara Leticia Dorantes, Roberto Figueroa, Gloria Gachuz, Marco Manríquez, Pablo Martínez, Rogelio Pérezcano, Natalia Rojas, Karla Sánchez, y Karina Venegas. Estos artistas tomaron el nombre de una canción de José Alfredo para de ahí generar su pieza con libertad de creación, lo que el público mexicalense podrá observar una gran variedad de propuestas en cuanto a trabajo, técnica y colorido.</p> <img class="one" src="http://www.zonalider.com/sites/default/files/styles/scale_max_width_auto_height/public/article/image/jose_alfredo_jimenez.jpg?itok=9cZnT7Ir" alt="x" width=250 height=200></img> <p class="dep">Eventos deportivos</p class="dep"> <div class="cuadrote">&#191;SAB&Iacute;AS QUE&#63;...El juego de béisbol más Largo tuvo lugar en el año 1981, en las Ligas Menores donde se jugaron 33 entradas. Se enfrentaban Rochester (NY) Red Wings contra Pawtucket (RI) Red Sox. Al entrar en la entrada número 21 el juego seguía empatado 2-2 y fue suspendido. Dos meses después el juego se reasignó y en 18 minutos el Pawtucket anotó la carrera del gane.</div> <img class="batorojo" src="http://allswalls.com/images/boston-red-sox-baseball-mlb-k-wallpaper-1.jpg" alt="x" width=200 height=170></img> <div class="cuadrito">Respecto al base ball se encuentra proximamente la variedad de juegos de la serie del caribe, incluyendo duelos epicos como el de CUBA vs HAITI , ¡No te los puedes perder!</div> <img class="caribe" src="" alt="x" width=200 height=170></img> <p class="blueboxie">&#161;SE LE CHISPOTEO&#33;GUADALAJARA, JALISCO (02/ABR/2017).- El Zorro es de los pocos animales capaces de tropezar con la misma piedra dos veces. Anoche, Matías Alustiza había tenido una noche de ensueño. Dos goles suyos tenían al Atlas en la pelea en el partido y en el Clausura 2017. A dos minutos del final el argentino puso la pelota en el manchón penal por segunda vez en el juego. En sus pies tenía la victoria que colocaba a los tapatíos en zona de Liguilla. Alustiza cobró el penalti que representaba la victoria igual que el penalti que representó en su momento el empate a tres. Un disparo con mucha dosis de humillación al arquero. Gibrán Lajud adivinó la intención del argentino y no se dejó sobajar una segunda vez. Recostó a su derecha y se quedó con la pelota y con el punto para su equipo. Sí, Alustiza hizo un “Ponchito” González y el Atlas empató 3-3 un juego que debía y tenía que ganar.</p> </body></html> 顶部一切看起来都正常,但页面底部缺少文本框“cuadrote”,并且图像被重新分配。昨天我还使用了命令位置(谷歌搜索,我真的不知道它是如何工作的)来修复图像,但它们再次变得混乱。 非常漂亮,请帮我,这是今天到期的学校项目 您的代码有些混乱,这可能听起来无关,但如果有人提供帮助,它可能会加快速度。 为什么要关闭包含类的标签? 仅举几例: <p class="dep">...</p class="dep"> <div class="cuadrote">....</div class="cuadrote"> <img class="caribe" src="" alt="x" width=200 height=170></img class="caribe"> 用途: <p class="dep">...</p>

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.