Search Results

Search found 13 results on 1 pages for 'user279244'.

Page 1/1 | 1 

  • wpf scrollviewer scrolltoverticaloffset

    - by user279244
    The events scrolltoVerticalOffset or the scrolltoHorizontalOffset do not change the values of the scrollviewer. Please tell me at which event does the values HorizontalOffset and the VerticalOffset get changed? I have tried LayoutUpdated() method but it goes in a infinite loop. Thanks in advance

    Read the article

  • WPF Combobox: Autocomplete

    - by user279244
    Hi, I have implemented a Autocomplete enabled Combobox in WPF. It is like below... private void cbxSession_Loaded(object sender, RoutedEventArgs e) { cbxSession.ApplyTemplate(); TextBox textBox = cbxSession.Template.FindName("PART_EditableTextBox", cbxSession) as TextBox; textBox.IsReadOnly = false; if (textBox != null) { textBox.KeyUp += new KeyEventHandler(textBox_KeyUp); textBox.KeyUp += delegate { ///open the drop down and start filtering based on what the user types into the combobox cbxSession.IsDropDownOpen = true; cbxSession.Items.Filter += a => { if (a.ToString().ToUpper().Contains(textBox.Text.ToUpper())) return true; else return false; }; }; } } void textBox_KeyUp(object sender, KeyEventArgs e) { if ((e.Key == System.Windows.Input.Key.Up) || (e.Key == System.Windows.Input.Key.Down)) { e.Handled = true; } else if (e.Key == System.Windows.Input.Key.Enter) { e.Handled = true; cbxSession.IsDropDownOpen = false; } } void textBox_KeyDown(object sender, KeyEventArgs e) { cbxSession.SelectionChanged -= cbxSession_SelectionChanged; if (e.Key == System.Windows.Input.Key.Enter) { e.Handled = true; cbxSession.SelectionChanged += cbxSession_SelectionChanged; } if ((e.Key == System.Windows.Input.Key.Up) || (e.Key == System.Windows.Input.Key.Down)) { e.Handled = true; } } private void cbxSession_DropDownClosed(object sender, EventArgs e) { if (cbxSession.Text != "") { TextBox textBox = cbxSession.Template.FindName("PART_EditableTextBox", cbxSession) as TextBox; if (!cbxSession.Items.Contains(textBox.Text)) { textBox.Text = cbxSession.Text; } } } private void cbxSession_DropDownOpened(object sender, EventArgs e) { cbxSession.Items.Filter += a => { return true; }; } <ComboBox x:Name="cbxSession" Width="260" Canvas.Top="5" Canvas.Left="79" Height="25" Visibility="Visible" SelectionChanged="cbxSession_SelectionChanged" MaxDropDownHeight="200" IsTextSearchEnabled="False" IsEditable="True" IsReadOnly="True" Loaded="cbxSession_Loaded" DropDownClosed="cbxSession_DropDownClosed" StaysOpenOnEdit="True" DropDownOpened="cbxSession_DropDownOpened"> <ComboBox.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel IsVirtualizing="True" IsItemsHost="True"/> </ItemsPanelTemplate> </ComboBox.ItemsPanel> </ComboBox> But, the problem I am facing is... When I try searching, the first character goes missing. And this happens only once. Secondly, When I am using Arrow buttons to the filtered items, the ComboboxSelectionChanged event is fired. Is there any way to make it fire only on the click of 'Enter'

    Read the article

  • WPF: adding Style to a slider

    - by user279244
    Hi I am using a Slider and putting a style element over it as follows... But however, I am not able to figure out why the style is not getting reflected. The RepeatButtons are not still visible. Thanks in advance <ResourceDictionary> <LinearGradientBrush x:Key="Stroke_Gradient" EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FF6E6E6E" Offset="0"/> <GradientStop Color="#FFFFFFFF" Offset="0.496"/> <GradientStop Color="#FF6E6E6E" Offset="1"/> </LinearGradientBrush> <Style x:Key="ScrollBar_RepeatButtonStyle1" d:IsControlPart="True" TargetType="{x:Type RepeatButton}"> <Setter Property="Background" Value="#FF6E6E6E"/> <Setter Property="BorderBrush" Value="#FFFFFFFF"/> <Setter Property="IsTabStop" Value="false"/> <Setter Property="Focusable" Value="false"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type RepeatButton}"> <Grid> <Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}"/> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> <ImageBrush x:Key="zoomBkgrnd" TileMode="None" ImageSource="zoombg.png" Stretch="Uniform"/> <Style x:Key="{x:Type Slider}" TargetType="{x:Type Slider}"> <Setter Property="Background" Value="{StaticResource zoomBkgrnd}"/> <Setter Property="BorderBrush" Value="{StaticResource zoomBkgrnd}"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Slider}"> <Grid x:Name="GridRoot"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <!-- TickBar shows the ticks for Slider --> <TickBar Visibility="Collapsed" x:Name="TopTick" Height="4" SnapsToDevicePixels="True" Placement="Top" Fill="{StaticResource zoomBkgrnd}"/> <Border Grid.Row="1" Margin="0" x:Name="Border" Height="4" Background="{StaticResource zoomBkgrnd}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2"/> <!-- The Track lays out the repeat buttons and thumb --> <Track Grid.Row="1" x:Name="PART_Track"> <Track.Thumb> <Thumb Width="10" Height="20" /> </Track.Thumb> <Track.IncreaseRepeatButton> <RepeatButton Style="{DynamicResource ScrollBar_RepeatButtonStyle1}" Command="Slider.IncreaseLarge"/> </Track.IncreaseRepeatButton> <Track.DecreaseRepeatButton> <RepeatButton Style="{DynamicResource ScrollBar_RepeatButtonStyle1}" Command="Slider.DecreaseLarge"/> </Track.DecreaseRepeatButton> </Track> <TickBar Visibility="Collapsed" Grid.Row="2" x:Name="BottomTick" Height="4" SnapsToDevicePixels="True" Placement="Bottom" Fill="{TemplateBinding Foreground}"/> </Grid> <ControlTemplate.Triggers> <Trigger Property="TickPlacement" Value="TopLeft"> <Setter Property="Visibility" Value="Visible" TargetName="TopTick"/> </Trigger> <Trigger Property="TickPlacement" Value="BottomRight"> <Setter Property="Visibility" Value="Visible" TargetName="BottomTick"/> </Trigger> <Trigger Property="TickPlacement" Value="Both"> <Setter Property="Visibility" Value="Visible" TargetName="TopTick"/> <Setter Property="Visibility" Value="Visible" TargetName="BottomTick"/> </Trigger> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Background" Value="{StaticResource zoomBkgrnd}" TargetName="Border"/> <Setter Property="BorderBrush" Value="{StaticResource zoomBkgrnd}" TargetName="Border"/> </Trigger> <!-- Use a rotation to create a Vertical Slider form the default Horizontal --> <Trigger Property="Orientation" Value="Vertical"> <Setter Property="LayoutTransform" TargetName="GridRoot"> <Setter.Value> <RotateTransform Angle="-90"/> </Setter.Value> </Setter> <!-- Track rotates itself based on orientation so need to force it back --> <Setter TargetName="PART_Track" Property="Orientation" Value="Horizontal"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary>

    Read the article

  • Scale a Visual Brush Background WPF

    - by user279244
    Hello, I have a Item called MiniMap in my xaml. I have set the background of it to a visual brush representting a canvas Item. Now, I want to scale the background to a ratio 0.7 . How can I do it? Thanks in advance <local:MiniMap Width="201" Height="134" x:Name="MiniMapItem" MinHeight="100" MinWidth="100" Opacity="1" SnapsToDevicePixels="True" Margin="0,0,20,20" VerticalAlignment="Bottom" HorizontalAlignment="Right"> <local:MiniMap.Background> <VisualBrush Visual="{Binding ElementName=viewport}" Stretch="None" TileMode="None" AlignmentX="Left" AlignmentY="Top" /> </local:MiniMap.Background> </local:MiniMap>

    Read the article

  • WPF: Image cilck event

    - by user279244
    I can find only MouseDown Event and MouseUp Event on a image in WPF. This causes some problem if I do MouseDown on some Image, Move the mouse and MouseUp event happens on some other image. Is there any other event that I can use to solve this problem. like MouseClick Event for Button element.

    Read the article

  • WPF Application Maximize Problem

    - by user279244
    How to set the Height and width of a WPF application on maximise? Problem I face is because of variable height of the windows taskbar in different computers Presently, I am doing it like this. Please suggest any better technique if (this.WindowState == WindowState.Maximized) { this.Height = primaryScreenHeight - 10 - System.Windows.Forms.SystemInformation.SizingBorderWidth; this.Width = primaryScreenWidth + 2 * System.Windows.Forms.SystemInformation.FrameBorderSize.Width; }

    Read the article

  • ASP.Net : Error in sending EMail from Google Apps hosted at Godaddy

    - by user279244
    Hello, I want to send EMail from my Website hosted at GoDaddy, and we are using Google Apps for Emails. Here is my code in ASP.Net/ C# MailMessage mMailMessage = new MailMessage(); mMailMessage.From = new MailAddress("[email protected]", "GotFeedback", System.Text.Encoding.UTF8); mMailMessage.To.Add(new MailAddress("[email protected]")); mMailMessage.Subject = "subject"; mMailMessage.SubjectEncoding = System.Text.Encoding.UTF8; mMailMessage.Body = body; mMailMessage.BodyEncoding = System.Text.Encoding.UTF8; mMailMessage.IsBodyHtml = true; mMailMessage.Priority = MailPriority.Normal; SmtpClient mSmtpClient = new SmtpClient(); mSmtpClient.UseDefaultCredentials = false; mSmtpClient.Credentials = new System.Net.NetworkCredential("[email protected]", "mypassword"); mSmtpClient.Host = "SMTP.GOOGLE.COM"; mSmtpClient.Port = 587; mSmtpClient.EnableSsl = true; try { mSmtpClient.Send(mMailMessage); } catch(Exception e) { string edsf = e.ToString(); } But I am getting Exception that it is unable to connect to remote server. Please help. Thanks

    Read the article

  • WPF: Canvas Events Not working

    - by user279244
    Hi I have set Mouse Events on a canvas as follows MouseUp="CanvasUp" MouseDown="CanvasDown" MouseMove="CanvasMove" But these are active only on the child elements like Images and Rectangles, but not on the empty space. Please tell me how to solve Thanks

    Read the article

1