Click here to Skip to main content
16,013,322 members

Comments by Member 12680324 (Top 7 by date)

Member 12680324 30-Jul-17 12:47pm View    
ToolTipService.IsEnabled is working, Thank you


Now the ToolTip become a textbox's watermark when textbox is string.empty without showing any tooltip on mouse over


<Trigger Property="IsMouseOver" Value="true">
<Setter Property="ToolTipService.IsEnabled" Value="False"/>


I'm not sure this's right how to use. But it still work
Member 12680324 30-Jul-17 7:48am View    
I want to hide tooltips when mouse is over textbox
<Window.Resources>
        <ControlTemplate x:Key="TextboxWithWatermark" TargetType="{x:Type TextBox}">
            <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True" Background="{TemplateBinding Background}">
                <Grid>
                    <ScrollViewer x:Name="PART_ContentHost" Focusable="False" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
                    <TextBlock Cursor="IBeam" VerticalAlignment="Top" x:Name="HintPresenter" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontWeight="{TemplateBinding FontWeight}" Margin="5,0,5,0" HorizontalAlignment="Left" Foreground="{TemplateBinding Foreground}" FontStyle="Italic" Opacity="0" Text="{TemplateBinding ToolTip}"/>
                </Grid>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Opacity" TargetName="border" Value="0.56"/>
                </Trigger>
                <Trigger Property="Text" Value="" >
                    <Setter Property="Opacity" TargetName="HintPresenter" Value="0.5"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
    </Window.Resources>
    <Grid x:Name="MainGrid">
        <StackPanel Margin="10" Width="150" HorizontalAlignment="Left">
            <Label Content="Information"/>
            <TextBox Template="{DynamicResource TextboxWithWatermark}" ToolTip="First name" Margin="1"/>
            <TextBox Template="{DynamicResource TextboxWithWatermark}" ToolTip="Last name" Margin="1"/>
            <TextBox Template="{DynamicResource TextboxWithWatermark}" ToolTip="Address" Margin="1"/>
            <TextBox Template="{DynamicResource TextboxWithWatermark}" ToolTip="E-mail address" Margin="1"/>
            <TextBox Template="{DynamicResource TextboxWithWatermark}" ToolTip="Tel" Margin="1"/>
            <Button Content="Send" HorizontalAlignment="Right"/>
        </StackPanel>
    </Grid>
Member 12680324 6-Oct-16 9:37am View    
Sorry about that, My app about plane to access all user's folder and file, list them and send to NAS every day, To review what happen, programs event change in their machine, Web browser history. and tranfer user work(etc. doc, xlm, mp4 mp3 jpeg and other media) store in to NAS, and get somefile in NAS back to them,

Maybe
1. Map network Drive
2. access and unlock some User Folder
3. transfer file. Send, Recive
4. Finallly, Lock Folder, Disconnect Mapped network drive


Member 12680324 6-Oct-16 8:50am View    
similar to if your try in cmd
"icacls /deny everyone:W "
if you run as Nomal user your will got Acess Deny

"net use n: \\nas\publicEveryday /user:employee employee"
if you run as Administrator, you will get wrong result
Member 12680324 6-Oct-16 8:38am View    
Yes, With Somthing like this
private bool runNormal()
{
    try
    {
        //Do Somthing normal , if run by admin it dosen't work
        ////Map Network Driver for user

    }
    catch { return false; }
}
private bool runAdmin()
{
    try
    {
        //Do Somthing advance, if run by NormalUser it dosen't work
        //Unlock Folder Form Deny Everyone To acessWrite
        //Ex. "C:// Programs file" or "%UserProfile%\Download"        
        //Unlock User Folder to possible for Write
    }
    catch { return false; }
}
public void StartMainProcess()
{
    if (runNormal() && runAdmin())
    {
        //Afert Unlock UserFile, 
        //Afert Map Network Drive
        //Continue to tranfer all file form mapped NW. Drive
        //To unlocked Folder
        // then Lock folders again (byadmin)
        // and remove network drive (byuser)
        // Finally User can only read and excute folder
    }
}