Search Results

Search found 2 results on 1 pages for 'bsh152s'.

Page 1/1 | 1 

  • Why is my image being displayed larger?

    - by bsh152s
    I'm trying to display an image on a splash screen and it's being stretched upon display. The image I'm trying to display is a simple bmp file. Any ideas why? In SplashWindow.xaml: <Window ... SizeToContent="WidthAndHeight"> <Grid> ... <Image Grid.Row="0" Source="{Binding SplashImage}"></Image> </Grid> </Window> In SplashViewModel.cs public ImageSource SplashImage { get { return ImageUtilities.GetImageSource(_splashImageFilenameString); } } From ImageUtilities.cs public static ImageSource GetImageSource(string imageFilename) { BitmapFrame bitmapFrame = null; if(!string.IsNullOrEmpty(imageFilename)) { if(File.Exists(imageFilename)) { bitmapFrame = BitmapFrame.Create(new Uri(imageFilename)); } else { Debug.Assert(false, "File " + imageFilename + " does not exist."); } } return bitmapFrame; }

    Read the article

  • How do I mimic Windows Explorer multi-select/drag-n-drop behavior in a DataGridView?

    - by bsh152s
    I'm trying to mimic the way Windows Explorer handles multiple selection. In a default DataGridView, you can select multiple items using Ctrl-click. But if you release the Ctrl key and then try and drag/drop the selected items, it clears the selected items and only selects the "hit" row. I found the following solution somewhere online. protected override OnMouseDown(MouseEventArgs e) { int hitRowIndex = HitTest(e.X, e.Y).RowIndex; if(!SelectedRows.Contains(Rows[hitRowIndex])) { base.OnMouseDown(); } } However, this causes other side effects. With the CTRL key pressed and mousing down on a selected item, the item remains selected. This makes sense because the mousedown event is bypassed if the row clicked on is selected. From looking at the behavior of Windows Explorer, it looks like the deselection of an item with the CTRL key held is not handled until the MouseUp event. Has anyone tried to do this?

    Read the article

1