How would I make it so that when "deleting" an image I can make it so that the delete key does it or a button I put on the application?

How would I make it so that when "deleting" an image I can make it so that the delete key does it or a button I put on the application?
I want it so that I can use either a button on the designer window or the delete key. I know how to do the or part but the trouble I'm having is coding the button in.
if (LastImageClicked != null && (e.Key == Key.Delete || Button))
This is the code that I have in the format I'm looking for I just don't know how to do it. Thanks for your help!

There are a number of things which are unclear about your question.
I'll tell you one way to approach this though.
Handle Window.PreviewKeyDown.
<Window
Window.PreviewKeyDown="Mainwindow_PreviewKeyDown"
Code behind
private void Mainwindow_PreviewKeyDown(object sender, KeyEventArgs e)
if (e.Key == Key.Delete)
File.Delete("p001.jpg");
I don't know enough about what you mean by LastImageClicked  but you need some way of knowing which path you are going to delete.
Then you might well have a problem if it's showing in an image control.
You will need to copy the picture off disk into a new bitmapimage object.
If you just do
<Image Source="p001.jpg"
Then that image will grab the file and you won't be able to delete it - you'll  get an error.
In my experimental code p001.jpg is set as content copy always so it ends up next to the exe in the bin when the solution compiles.
You would probably want a full path to a file there.
Hope that helps.
Recent Technet articles:
Property List Editing;  
Dynamic XAML

Similar Messages

  • I have a document in Pages that, when I export it to Word, makes all the pages bold font no matter what I have tried.

    I have a document in Pages that, when I export it to Word, makes all the pages bold font no matter what I have tried. What am I missing?

    You might have luck in the Pages community. I’ll ask the hosts to move your post there.
    Pages Community

  • Can you automatically delete anchor points when a new image is placed on top - so that it 'replaces'

    Hi all,
    I know that I can delete anchor points but I was wondering if there is a shortcut to do it on a larger scale.
    Can you automatically delete anchor points when a new image is placed on top - so that it 'replaces' the image, only on the parts obviously that you cover with the new one.
    Thank you all

    Hi,
    I'm using CS6, and I have a tree vector image, and I am trying to put names on top, but when I do this to keep it clean with no anchor points (as my other software cant read it with all the points in it) I have to manually delete each one but it deletes the whole path and I then end up with a tree, names on top, and a big gappy circle around the names.
    So really, I wanted to add the names on top, and have that delete all anchors underneath .
    Does this make sense? :S

  • I understand that when using Numbers/Pages - an up-arrow on a document means that the file is still to be uploaded to the cloud, what does a down arrow mean? It seems the document can't be accessed until the arrow clears.

    I understand that when using Numbers/Pages - an up-arrow on a document means that the file is still to be uploaded to the cloud, what does a down arrow mean? It seems the document can't be accessed until the arrow clears.

    I believe what it's supposed to mean is that some changes were made to the document on another device, and those changes were saved back to the cloud.  Now you've opened iWork on a different device to access that document - it compares the document you've got locally with the one in the could, sees some recent changes and downloads them.
    What gets me is why this sometimes happens even when I've not made any changes to a document from another device.

  • My friend thinks that if I have wifi i can make an international call for free is he right?

    My friend thinks that if I have wifi i can make an international call for free is he right?
    I think he is confused with imessage but that doesnt even work on calling.

    You cannot make a cellular international call for free just because you have a WiFi connection. However, you can make low cost International calls over WiFi using apps such ase Skype or Google Voice. You can also Facetime to another iPhone, iPad or Mac over WiFi or cellular data; that is free.

  • HT201335 when using apple tv with my ipad, the mirroring function does not work, screen goes black, what is the issue?

    when using apple tv with my ipad, the mirroring function does not work, screen goes black, what is the issue?  My son's Ipad(same as kind as mine) works ok with the apple tv but mine does not.  Any suggestions?

    Hello Nina Izurin,
    While written for the iPhone, the troubleshooting below can help resolve issues with your iPad's camera, as well.
    Camera isn't functioning or has undesired image quality
    If the screen shows a closed lens or black image, force quit the Camera app.
    If you do not see the Camera app on the Home screen, try searching for it in Spotlight. If the camera does not show up in the search, check to make sure that Restrictions are not turned on by tappingSettings > General > Restrictions.
    Ensure the camera lens is clean and free from any obstructions. Use a microfiber polishing cloth to clean the lens.
    Cases can interfere with the camera and the flash. Try gently cleaning the lens with a clean dry cloth or removing the case if you see image or color-quality issues with photos.
    Try turning iPhone off and then back on.
    Tap to focus the camera on the subject. The image may pulse or briefly go in and out of focus as it adjusts.
    Try to remain steady while focusing:
    Still images: Remain steady while taking the picture. If you move too far in any direction, the camera automatically refocuses to the center.
    Note: If you take a picture with iPhone turned sideways, it is automatically saved in landscape orientation.
    Video: Adjust focus before you begin recording. You can also tap to readjust focus while recording. Exiting the Camera application while recording will stop recording and will save the video to the Camera Roll.
    Note: Video-recording features are not available on original iPhone or iPhone 3G.
    If your iPhone has a front and rear camera, try switching between them to verify if the issue persists on both.
    My issue is still not resolved. What do I do next?
    Contact Apple Support.
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/TS2802
    Cheers,
    Allen

  • Im planning to upgrade my MBP late 2011's ram from 4gb to 8gb. Is there any specific brand of ram that i should buy or i can buy any brand that suits my MBP.

    im planning to upgrade my MBP late 2011's ram from 4gb to 8gb. Is there any specific brand of ram that i should buy or i can buy any brand that suits my MBP? im aware of all the details that i need to consider pc3 - 10600 1333MHz 4gb. i just want to know is there any specific brand or i can use any brand,
    Thank you.

    The most reliable sources for Mac compatible RAM are OWC and Crucial.  Macs seem to be selective with RAM so some brands will not work. Make certain that you get RAM with the exact specifications that apply to your MBP.
    Ciao.
    If you have a need, be advised that you MBP can actually support 16 GB RAM.
    Message was edited by: OGELTHORPE

  • I have completely lost my safari.  I was getting an error and I lost the address bar.  I tried to fix it by changing the home page on the preferences.  I don't know what to put in the home page now.  How do I get safari back?

    I have completely lost my safari.  I was getting an error and I lost the address bar.  I tried to fix it by changing the home page on the preferences.  I don't know what to put in the home page now.  How do I get safari back?

    I tried editing my first post but couldn't get there...
    If you can open Safari go to the top of your screen, click Safari / Preferences then select the General stab. You can type in the web address for your Home page there.

  • How do I reference a table in a cell so that when I type in a word, other cells in that row are automatically filled in?

    I'm making a cheat sheet for my fantasy football league. To this point I have separate sheets that list players at various positions (the sheets are characterized by the positions they cover i.e. quarterback/running back etc). I also have at the end a table that lists a team abbreviation (identical to how I would reference the team in the other sheets) with that team's bye week and schedule listed.
    I want to be able to type a team name next to a player's name and have that team's information be filled into the cells on the same row, by referencing that table I have at the end.
    Can anyone help? Very much appreciated. Thanks.

    Take a look at VLOOKUP in the iWork Formulas and Functions User Guide.
    You'll also find several discussions here on essentially the same question by searching for VLOOKUP. Also check the More Like This list to the right of these messages.
    Regards,
    Barry
    PS: The iWork Formulas and Functions User Guide may be downloaded via the Help menu in Numbers.
    B

  • How do I remove email address not in contact list.they drop down when in the "to"field trying to either fwd ,send or reply. How did they get there in the first place. And the edit key does not show in my contacts

    When sending email wether reply or fwd or new addresses drop down that not show in my contacts. How do,I remove them and how did they get there?  And the edit key notmshowing in my contacts.
    Someone else's reply  nothing that could be done short of clearing out all contacts and starting over. But these are not in my contacts!!!!!!!!!! So,that is not an answer

    So are you telling me that anyone I ever send n email to will appear in the drop down list but not in contacts? I don't have that many contacts on list so are younsayingmi would have to remove them all to remove the unwanted address in the drop down to go away? If that is not  please explain

  • I want a slideshow that when any individual image is clicked on it goes full screen

    Right now I have a slideshow that only fills the centre of the page, which is how I want it. I do not want a fullscreen slideshow. However, what I want is that when anyone clicks a particular image within this slideshow, that image becomes full-size and covers the rest of the site, and to get back to the normal slideshow you just click around the image (I guess a similar thing is how photos are viewed on Facebook after a thumbnail is clicked, that is sort of what I want).

    Try using/experimenting with the Lightbox Composition Slideshow Widget.

  • HT4718 re magic mouse,it seems that when i put my mac air to sleep with my magic mouse left on and wake my computer with the mouse the wi-fi does not connect. but if I put the mac to sleep and then turn off the mouse and wake the computer wifi connects wh

    Re: magic mouse
    I use Mavericks and I notice that when I put my mac to sleep and have my magic mouse on and when i go to wake the computer up with the mouse on my wi-fi will not connect?
    Put if i shut off the magic mouse and put the computer to sleep and turn my mouse back on and wake the computer up the wi-fi connects, this is a bit strange. This there anyone out there with same problem? is this a Mavericks thing that is not working with the apple magic mouse?
    Interested in hearing from you.
    Thanks

    Mr. iPadfan wrote:
    ... does my iMac model... support Hibernatemode 3 alias "Safe Sleep" to protect my Mac against damages due to power outage?
    You can set hibernate mode to 3, but it seems to me its only benefit could be if power were to be lost after the iMac was already sleeping. Sleepimage is written to disk prior to system sleep. If your iMac lost power while it was "awake" you would certainly lose any unsaved work no matter what hibernate mode you choose.
    The problem is that an iMac without power no longer sleeps, it's dead. Upon restoring power you need to cold boot, and I seriously doubt sleepimage can be forced to load in that event. Sleepimage is loaded upon wake from "safe sleep", not from boot as far as I know.
    It is simple enough for you to try, so go ahead and see if it does what you want. Other than creating a 16 GB sleepimage file it did not appear to do anything beneficial on the iMac I am using though (a later model).
    The file location is /private/var/vm/sleepimage
    Configure hibernatemode, verify the file is created, do some work on your Mac, don't save it to disk (and don't use Pages or similar app that saves work on its own), let it sleep, then pull the plug. I think you will see what I mean.

  • How to speed up PDF batch processing when creating searchable image PDF's?

    When using the batch processing tool in adobe to create multiple searchable image files into PDF, the process is considerably slower compared to scanning straight from the adobe window and importing scan back into adobe. Is there a way to get around this?

    The flaw is here:
    This is a Windows Server 2012 box
    Adobe desktop programs are generally not officially supported on server operating systems. Whatever issues you have are probably due to things like local users vs. network users, disk quota, specific group policies or plain and simple another process occupying or blocking the same port that the QT server is using. In any case, this is nothing we can figure out for you. You have to sit down and work your way through the server's administration tools, turn off stuff, change user permissions. Check the event logs for conflicting processes or use tools like Sysinternals' Process Monitor or Wireshark to track down port collisions and otehr problems.
    Mylenium

  • How do I get the arrow keys to move one character at a time in the address bar or search box?

    I can no longer get the arrow keys to advance or retard "one character at a time" in the address bar, the search box, or on any form in Firefox. This feature works in other browsers without a problem. The "Home" and "End" keys do not work either. How do I fix this behavior?

    How do I configure the AX to connect to the hub's wireless network? It will only scan one base station Airport Express at a time in the Airport Utility. I think what I am trying to do is use the hub as a router to the two AX's. Is there a specific way to set this up?
    To set up the AX to join a wireless network as a "Wireless Client," using the AirPort Utility, either connect to the AX's wireless network or temporarily connect your computer directly (using an Ethernet cable) to the Ethernet port of the AX, and then, try these settings:
    Launch the AirPort Utility.
    Select the AX.
    If not already connected to the AX's wireless network, go ahead and switch to it when prompted.
    AirPort Utility > Select the AX > Manual Setup > AirPort > Wireless
    Wireless Mode: Join a wireless network
    Network Name: <type in the network name/SSID of the wireless network that you want to join or select it from the pop-up menu>
    Wireless Security: None OR, if you are using security on your wireless network:
    Wireless Security: <Select the appropriate level of security for the existing wireless network: WPA/WPA2 Personal | WPA2 Personal>
    Password: <enter your wireless network security password>
    Verify Password: <re-enter the same security password>
    Click Update to write the new settings to the AX.

  • I just got a new iphone! I can't restore some in app content! The reason is I need to do the security questions. I'm 85% sure I put in the right answers but it's not working. Also when I try to reset it threw email I never get the message to fix it! Help!

    I have got a new iphone recently. But I can't restore in app purchases. I have tried many times to reset it threw email and never got the message. I know I'm checking the right email I get your advertising messages there. I'm 85% sure I'm using the right answers! This has been very frustrating! Please help make this right!

    We are fellow users here on these user-to-user forums, you're not talking to iTunes Support nor Apple.
    The reset link for the security question will send the email to your rescue email account : http://support.apple.com/kb/HT5312 -  that is the email account that you are checking, and you've checked the spam folder on it as well as the inbox, and tried clicking the reset link again ?
    If you aren't receivineg the email then you will need to contact Support in your country to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    When they've been reset you can then use the steps half-way down the HT5312 link above to view your rescue email address to check that it's correct, in case you need to use it in the potential future use

Maybe you are looking for

  • ??MsI G4Ti4600/4400/4200 card??

    Hello, I bought my G4ti4400 card in June 2002, and it stopped working after 3 or so months later.  ;(   Anyways, I'm having it RMAed this week, and I was wondering: How long have you guys had you card without it going screwy? I mean, who has had thei

  • Creation of budget  billing

    Hi  dudes,   Iam  trying  to  create the budget  billing  plan. in step  1,i went  to  EA61. STEP 2:  I  eneterd the contract number. step 3.i  executed and error rises saying " contract account  so  ans o  needs to  be changd for budget  billing  01

  • Multiple quotes need to be created - need to finalise the last one

    Hi, Can we create a  multiple versions of a quote (alternative offers & price revisions) with a consistent naming convention linked to it and a possibility to indicate the final quote identified by using final quote status. If it possible.Can you exp

  • Screen turning off randomly, cannot turn back on.  potential disaster for live music i'm doing!

    screen goes black, laptop seems to have not turned off but nothing can turn the screen on.  seems fine after a reboot but problem recurs at some random future inconvenient point in time.  problem is annoyingly inconsistent - it will occur at random (

  • Conection to local db through citrix

    Hi all, I'm running an application that connects to a db (oracle 8 installed in server) in citrix and after that the data collected must be inserted in a db installed in local (oracle 10g). The problem starts when trying to connect to the local db (1