Search Results

Search found 4 results on 1 pages for 'ajtp'.

Page 1/1 | 1 

  • Winforms: How to prevent vertically resize in VB.NET

    - by ajtp
    Hi, Working with winforms I wonder if there is some way to prevent vertically resize of the form. I would like to allow user to resize form in all directions except vertically.Moreover I would like to allow vertically resize in upward direction, but not downward. I have tried to use maximumsize by setting it to: Me.maximumsize = new size(0,me.height) I set width to 0 because I want to allow user to change form width. Unfortunately it doesn't work. Any ideas?

    Read the article

  • Adding programatically a command to a listbox in WPF

    - by ajtp
    In my WPF application there is a listbox with items. The listbox is populated via a xmldataprovider from XAML and then binding it to Itemssource property of the listbox. Well, from XAML, I bind a comand to the listbox by doing: <ListBox.CommandBindings> <CommandBinding Command="{x:Static local:mainApp.MyCmd}" CanExecute="CanExecute" Executed ="Executed" /> </ListBox.CommandBindings> but I don't know how to programatically bind a command to each listboxitem. How to do it? Thanks in advance.

    Read the article

  • Implementing custom CanExecuteChanged event with Commands in WPF

    - by ajtp
    Hi everybody, I try to do a custom CanExecuteChanged event for a command button. Inside CanExecuteChanged event I would like to do some stuff when canExecute value change but I don't want to do it by implementing a custom command button class (deriving from Button and Implementing ICommandSource). Also I don't want to do my stuff into CanExecute method. Any ideas? Thanks.

    Read the article

  • Background custom button animation using WPF

    - by ajtp
    Hi, I am using Resources dictionaries to customize my controls and apply them as themes to my WPF application so I have implemented one for the button control. A code snippet for my custom Button.xaml is (its namespace is MyWPFApp.Themes): <ResourceDictionary ...> ... <LinearGradientBrush x:Key="NormalBackground" EndPoint="0,1" StartPoint="0,0"> <GradientStop Color="sc#1.000000, 0.250141, 0.333404, 0.884413" Offset="0"/> <GradientStop Color="#ccffffff" Offset="1"/> </LinearGradientBrush> <LinearGradientBrush x:Key="OverBackground" EndPoint="0,1" StartPoint="0,0"> <GradientStop Color="#da5e69" Offset="0"/> <GradientStop Color="#d12e27" Offset="1"/> </LinearGradientBrush> <LinearGradientBrush x:Key="ClickBackground" EndPoint="0,1" StartPoint="0,0"> <GradientStop Color="#d22828" Offset="1"/> <GradientStop Color="#b00000" Offset="0"/> </LinearGradientBrush> ... <Style TargetType="{x:Type Button}"> ... <Setter Property="Background" Value="{StaticResource NormalBackground}"/> ... </Style> </ResourceDictionary> and I apply it by doing the following from my main Application.xaml: <Application ...> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Themes/Button.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application> What I try to do is to change background color, for example, from White to Lime for 6 seconds by doing this from one of my pages, MyPage1.xaml, using StoryBoard: <Page x:Class="MyWPFApp.Pages.MyPage1" ...> <Page.Resources> ... <Storyboard x:Key="sbBtnResetHC" Storyboard.TargetName="BtnResetHC" Storyboard.TargetProperty="(Background). (SolidColorBrush.Color)"> <ColorAnimation From="Pink" To="Green" By="Blue" Duration="0:0:6" RepeatBehavior="3x" AutoReverse="True" /> </Storyboard> ... </Page.Resources> ... <Button x:Name="BtnResetHC" Click="BtnResetHC_Click" Width="90" Visibility="Collapsed" /> ... </Page> and from code behind MyPage1.xaml.cs I start animation by doing this: Storyboard sb = (Storyboard)FindResource("sbBtnResetHC"); sb.Begin(); when the button is visible, but it doesn't work for me. Any ideas what's wrong? Maybe another possibility, as I want the animation starts on button visible is to do a trigger for the button over Visibility property, Is it a better solution? Thanks a lot!

    Read the article

1