Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用vb.net添加属性_Vb.net - Fatal编程技术网

使用vb.net添加属性

使用vb.net添加属性,vb.net,Vb.net,我试图在表单中的某些文本框中添加属性。我所做的是,当用户关注某些字段时,我想设置blur属性。下面是代码。如果我做错了什么,请告诉我 textbox.Attributes.Add(“onfocus(),“blur”)下面是一个简单的WPF示例。单击按钮将模糊和取消模糊两个文本框 我希望这为你指明了正确的方向 XAML: <Window x:Class="MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/prese

我试图在表单中的某些文本框中添加属性。我所做的是,当用户关注某些字段时,我想设置blur属性。下面是代码。如果我做错了什么,请告诉我


textbox.Attributes.Add(“onfocus(),“blur”)
下面是一个简单的WPF示例。单击按钮将模糊和取消模糊两个文本框

我希望这为你指明了正确的方向

XAML:

<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="188" Width="373">
<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition/>
        <RowDefinition/>
        <RowDefinition/>
        <RowDefinition/>
        <RowDefinition/>
    </Grid.RowDefinitions>

    <TextBox Name="textBoxOne" Grid.Column="0" Grid.Row="0" Margin="10,4" Text="TextBoxBase One"/>
    <TextBox Name="textBoxTwo" Grid.Column="0" Grid.Row="1" Margin="10,4" Text="TextBoxBase Two"/>
    <TextBox Name="textBoxThree" Grid.Column="0" Grid.Row="2" Margin="10,4" Text="TextBoxBase Three"/>
    <TextBox Name="textBoxFour" Grid.Column="0" Grid.Row="3" Margin="10,4" Text="TextBoxBase Four"/>

    <Button Grid.Column="0" Grid.Row="4" Content="Toggle Blur" Click="ToggleBlur_Click"/>
</Grid>
我相信您特别需要的代码是:

Dim blur As Effects.BlurEffect = New Effects.BlurEffect() 
blur.Radius = 5 
textBoxOne.Effect = blur 

简单的模糊不会有帮助我猜你是想模糊它还是使它成为只读?ASP.NET文本框有一个只读属性。
Dim blur As Effects.BlurEffect = New Effects.BlurEffect() 
blur.Radius = 5 
textBoxOne.Effect = blur