Search Results

Search found 549 results on 22 pages for 'clipboard'.

Page 9/22 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Some languages don't work when using Word 2007 Spellcheck from Interop

    - by Tridus
    I'm using the Word 2007 spellchecker via Interop in a VB.net desktop app. When using the default language (English), it works fine. If I set the language to French via LanguageId, it also works. But if I set it to French (Canadian) (Word.WdLanguageID.wdFrenchCanadian), it doesn't work. There's no error message, it simply runs and says the document contains no errors. I know it does, if I paste the exact same text into Word itself and run it with the French (Canadian) dictionary, it finds errors. Just why that dictionary doesn't work is kind of a mystery to me. Full code below: Public Shared Function SpellCheck(ByVal text As String, ByVal checkGrammar As Boolean) As String ' If there is no data to spell check, then exit sub here. If text.Length = 0 Then Return text End If Dim objWord As Word.Application Dim objTempDoc As Word.Document ' Declare an IDataObject to hold the data returned from the ' clipboard. Dim iData As IDataObject objWord = New Word.Application() objTempDoc = objWord.Documents.Add objWord.Visible = False ' Position Word off the screen...this keeps Word invisible ' throughout. objWord.WindowState = 0 objWord.Top = -3000 ' Copy the contents of the textbox to the clipboard Clipboard.SetDataObject(text) ' With the temporary document, perform either a spell check or a ' complete ' grammar check, based on user selection. With objTempDoc .Content.Paste() .Activate() .Content.LanguageID = Word.WdLanguageID.wdFrenchCanadian If checkGrammar Then .CheckGrammar() Else .CheckSpelling() End If ' After user has made changes, use the clipboard to ' transfer the contents back to the text box .Content.Copy() iData = Clipboard.GetDataObject If iData.GetDataPresent(DataFormats.Text) Then text = CType(iData.GetData(DataFormats.Text), _ String) End If .Saved = True .Close() End With objWord.Quit() Return text End Function

    Read the article

  • error in copy/ paste of image

    - by sayyad
    I am getting an error by implementing this simple code. I donot understand where I am doing mistake. // ERROR An unhandled exception of type 'System.NullReferenceException' occurred in ImageCSharp.exe Additional information: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt. I can get clipboard text but why i can't get /set image. //CODE public void copy() { // Determine the active child form. fImage activeChild = this.ActiveMdiChild as fImage; if (activeChild != null) { PictureBox mypicbox = activeChild.picbox; string win_name = activeChild.Tag.ToString(); Clipboard.SetImage(mypicbox.Image); Clipboard.SetText(win_name); } } private void paste() { Image im= Clipboard.GetImage(); this.pictureBox1.Image = im; MessageBox.Show(im.Size.ToString()); } regards,

    Read the article

  • What is the correct way to move a file?

    - by Joe McDonald
    We had an issue at my work where I cut and pasted some files. Immediately when I did it, a ton of files were lost. I've been working in IT for 10+ years. I know how to cut and paste a file. Well, when it went up to my managers as to why the files were lost, they deemed it to my cut and paste that caused all the problems and asked why in the world someone as knowledgeable as me would ever cut and paste a file, and didn't I know that was totally the wrong way to move a file? The correct way to move a file is to drag the file. When cutting and pasting, it moves that 1+ GB file (on the server) to the clipboard (on my PC), which, obviously, will cause problems. Dragging a file never hits the clipboard. Be honest, I don't believe that for a minute. I believe when I cut and paste text, it goes to the clipboard. I've seen it in the old versions of windows. But when right clicking on 100+ files that equals 1+ GB, I can't believe that all that data is copied immediately out of whatever share I'm on at the server across my wireless on my laptop to my local clipboard to just go back to the server to another share. It seems they would build some logic in the server OS or my local OS (more likely my local OS) that would say when copying files, don't perform the move action until I click paste and if the files are staying local to where they were before, just move them. So, who's right?

    Read the article

  • Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

    - by ScottGu
    This is the twenty-third in a series of blog posts I’m doing on the VS 2010 and .NET 4 release. Today’s blog post covers some of the extensibility improvements made in VS 2010 – as well as a cool new "PowerCommands for Visual Studio 2010” extension that Microsoft just released (and which can be downloaded and used for free). [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu] Extensibility in VS 2010 VS 2010 provides a much richer extensibility model than previous releases.  Anyone can build extensions that add, customize, and light-up the Visual Studio 2010 IDE, Code Editors, Project System and associated Designers. VS 2010 Extensions can be created using the new MEF (Managed Extensibility Framework) which is built-into .NET 4.  You can learn more about how to create VS 2010 extensions from this this blog post from the Visual Studio Team Blog. VS 2010 Extension Manager Developers building extensions can distribute them on their own (via their own web-sites or by selling them).  Visual Studio 2010 also now includes a built-in “Extension Manager” within the IDE that makes it much easier for developers to find, download, and enable extensions online.  You can launch the “Extension Manager” by selecting the Tools->Extension Manager menu option: This loads an “Extension Manager” dialog which accesses an “online gallery” at Microsoft, and then populates a list of available extensions that you can optionally download and enable within your copy of Visual Studio: There are already hundreds of cool extensions populated within the online gallery.  You can browse them by category (use the tree-view on the top-left to filter them).  Clicking “download” on any of the extensions will download, install, and enable it. PowerCommands for Visual Studio 2010 This weekend Microsoft released the free PowerCommands for Visual Studio 2010 extension to the online gallery.  You can learn more about it here, and download and install it via the “Extension Manager” above (search for PowerCommands to find it). The PowerCommands download adds dozens of useful commands to Visual Studio 2010.  Below is a screen-shot of just a few of the useful commands that it adds to the Solution Explorer context menus: Below is a list of all the commands included with this weekend’s PowerCommands for Visual Studio 2010 release: Enable/Disable PowerCommands in Options dialog This feature allows you to select which commands to enable in the Visual Studio IDE. Point to the Tools menu, then click Options. Expand the PowerCommands options, then click Commands. Check the commands you would like to enable. Note: All power commands are initially defaulted Enabled. Format document on save / Remove and Sort Usings on save The Format document on save option formats the tabs, spaces, and so on of the document being saved. It is equivalent to pointing to the Edit menu, clicking Advanced, and then clicking Format Document. The Remove and sort usings option removes unused using statements and sorts the remaining using statements in the document being saved. Note: The Remove and sort usings option is only available for C# documents. Format document on save and Remove and sort usings both are initially defaulted OFF. Clear All Panes This command clears all output panes. It can be executed from the button on the toolbar of the Output window. Copy Path This command copies the full path of the currently selected item to the clipboard. It can be executed by right-clicking one of these nodes in the Solution Explorer: The solution node; A project node; Any project item node; Any folder. Email CodeSnippet To email the lines of text you select in the code editor, right-click anywhere in the editor and then click Email CodeSnippet. Insert Guid Attribute This command adds a Guid attribute to a selected class. From the code editor, right-click anywhere within the class definition, then click Insert Guid Attribute. Show All Files This command shows the hidden files in all projects displayed in the Solution Explorer when the solution node is selected. It enhances the Show All Files button, which normally shows only the hidden files in the selected project node. Undo Close This command reopens a closed document , returning the cursor to its last position. To reopen the most recently closed document, point to the Edit menu, then click Undo Close. Alternately, you can use the CtrlShiftZ shortcut. To reopen any other recently closed document, point to the View menu, click Other Windows, and then click Undo Close Window. The Undo Close window appears, typically next to the Output window. Double-click any document in the list to reopen it. Collapse Projects This command collapses a project or projects in the Solution Explorer starting from the root selected node. Collapsing a project can increase the readability of the solution. This command can be executed from three different places: solution, solution folders and project nodes respectively. Copy Class This command copies a selected class entire content to the clipboard, renaming the class. This command is normally followed by a Paste Class command, which renames the class to avoid a compilation error. It can be executed from a single project item or a project item with dependent sub items. Paste Class This command pastes a class entire content from the clipboard, renaming the class to avoid a compilation error. This command is normally preceded by a Copy Class command. It can be executed from a project or folder node. Copy References This command copies a reference or set of references to the clipboard. It can be executed from the references node, a single reference node or set of reference nodes. Paste References This command pastes a reference or set of references from the clipboard. It can be executed from different places depending on the type of project. For CSharp projects it can be executed from the references node. For Visual Basic and Website projects it can be executed from the project node. Copy As Project Reference This command copies a project as a project reference to the clipboard. It can be executed from a project node. Edit Project File This command opens the MSBuild project file for a selected project inside Visual Studio. It combines the existing Unload Project and Edit Project commands. Open Containing Folder This command opens a Windows Explorer window pointing to the physical path of a selected item. It can be executed from a project item node Open Command Prompt This command opens a Visual Studio command prompt pointing to the physical path of a selected item. It can be executed from four different places: solution, project, folder and project item nodes respectively. Unload Projects This command unloads all projects in a solution. This can be useful in MSBuild scenarios when multiple projects are being edited. This command can be executed from the solution node. Reload Projects This command reloads all unloaded projects in a solution. It can be executed from the solution node. Remove and Sort Usings This command removes and sort using statements for all classes given a project. It is useful, for example, in removing or organizing the using statements generated by a wizard. This command can be executed from a solution node or a single project node. Extract Constant This command creates a constant definition statement for a selected text. Extracting a constant effectively names a literal value, which can improve readability. This command can be executed from the code editor by right-clicking selected text. Clear Recent File List This command clears the Visual Studio recent file list. The Clear Recent File List command brings up a Clear File dialog which allows any or all recent files to be selected. Clear Recent Project List This command clears the Visual Studio recent project list. The Clear Recent Project List command brings up a Clear File dialog which allows any or all recent projects to be selected. Transform Templates This command executes a custom tool with associated text templates items. It can be executed from a DSL project node or a DSL folder node. Close All This command closes all documents. It can be executed from a document tab. How to temporarily disable extensions Extensions provide a great way to make Visual Studio even more powerful, and can help improve your overall productivity.  One thing to keep in mind, though, is that extensions run within the Visual Studio process (DevEnv.exe) and so a bug within an extension can impact both the stability and performance of Visual Studio.  If you ever run into a situation where things seem slower than they should, or if you crash repeatedly, please temporarily disable any installed extensions and see if that fixes the problem.  You can do this for extensions that were installed via the online gallery by re-running the extension manager (using the Tools->Extension Manager menu option) and by selecting the “Installed Extensions” node on the top-left of the dialog – and then by clicking “Disable” on any of the extensions within your installed list: Hope this helps, Scott

    Read the article

  • How to create basic Adobe Illustrator files programatically?

    - by Jonas Follesø
    I need to create a really basic Adobe Illustrator file on the clipboard that I can paste in Adobe Illustrator or Expression Design. I'm looking for code samples on how to programaticaly generate Adobe Illustrator Files, preferably from C# or some other .NET language (but at the moment any language goes). I have found the Adobe Illustrator 3 File Format documentation online but it's allot to digest for this simple scenario. I don't want to depend on the actual Adobe Illustrator program (COM interop for instance) to generate my documents. Must be pure code. The code is for an Expression Studio addin, and I need to be able to create something on the clipboard I can paste into Expression Design. After looking at the formats Expression Design puts on the clipboard when copying a basic shape I've concluded that ADOBE AI3 i the best one to use (the others are either rendered images, or cfXaml that you cannot paste INTO Design). So based on this I can't use SWG which would probably been easier. Another idea might be to use a PDF component as the AI and PDF format is supposed to be compatible? I'm also finding some references to a format called "Adobe Illustrator Clipboard Format" (AICB), but can't find allot of documentation about it.

    Read the article

  • System.Threading.ThreadstateException

    - by Yasindu
    Hi, I'm developing an adding for office powerpoint application. I'm trying to display a description of the object(Customized object) currently dropped on the powerpoint slide in design mode(Design mode of the powerpoint). When i click on my addin the related object description will be displayed on a tabbed window as the first tabpage. There is a button on the tab page, and when i click on it i need the description to get copied to windows clipboard. I tried this using clipboardclass it throws the following exception, System.Threading.ThreadstateException {"Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it."} Code for clipboard: Clipboard.Clear() Clipboard.SetText(lblObjectID.Text) I searched the net for a solution and got couple of answers like, 1. Put [STAThread] in the main function 2. Thread.CurrentThread.SetApartmentState(ApartmentState.STA) Immediately before your call to SetDataObject. But I'm not sure where to put the 1st one and the 2nd option didn't work. Can anyone help me please. Thanks.

    Read the article

  • Mac & Photoshop: Screen capture of an application then pasting it into a new document in photoshop i

    - by maytheschwartzbewithyou
    This used to work perfectly up until about a month or two ago. When doing a screen capture onto the clipboard (cmd + ctr + shift + 4) and pasting it into a new document in Photoshop (only in photoshop, pasting it elsewhere like mail works fine), the drop shadow around the application doesn't look right. What can i do to fix this? Thanks. Pasting into photoshop from clipboard. http://i49.tinypic.com/2el5h6d.jpg

    Read the article

  • How to paste metafile from Microsoft Word at expected size

    - by Joel
    I'm having an issue in a WPF application using the RichTextBox where content being pasted in from Microsoft Word is mangled. To work around the issue, I found that Word includes a metafile on the clipboard, and I can get the metafile from the clipboard using interop (WPF wouldn't properly import the metafile either). My problem, though, is that a metafile is scalable and so whether a user pastes a whole page of content or a small amount, the metafile claims that its Width is 4390. However, if I strip the clipboard of everything but the metafile and paste it into MSPaint, the resulting bitmap in paint has properly scaled the pasted metafile, so it seems to me that there must be some information somewhere that indicates the real size. Does anyone know how to get the proper expected size of the Metafile?

    Read the article

  • Use Javascript to copy Text from Label

    - by Josh
    Hello All- Label1 (asp.net control) is located inside Panel1 of my webpage and I have a button called bt. What is the Javascript to copy the Text from Label1 to the clipboard? Thanks, @ artlung, I placed the below code just outside of my form but inside the body. The last line of code I placed inside Panel1 of my form. Anything wrong with this code because nothing happens when I click the Copy to Clipboard button. <script language="JavaScript"> var clip = new ZeroClipboard.Client(); clip.addEventListener( 'mouseDown', function(client) { // set text to copy here clip.setText( document.getElementById('form1.Label1').value ); // alert("mouse down"); } ); clip.glue( 'd_clip_button' ); </script> The next line of code is above the script tags but inside Panel1 in my form <div id="d_clip_button">Copy To Clipboard</div>

    Read the article

  • Adding UIComponent to both Canvas and Tree in Flex 3

    - by Chris M
    I currently am trying to add a custom class which subclasses UIComponent to both a tree and a canvas, but when I try to re-order the tree by dragging I get this error: TypeError: Error #1010: A term is undefined and has no properties. at mx.controls::Tree/get firstVisibleItem()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\Tree.as:764] at flash.utils::ByteArray/writeObject() at flash.desktop::Clipboard/putSerialization() at flash.desktop::Clipboard/convertFlashFormat() at flash.desktop::Clipboard/setData() at mx.managers::NativeDragManagerImpl/doDrag()[C:\autobuild\3.2.0\frameworks\projects\airframework\src\mx\managers\NativeDragManagerImpl.as:282] at mx.managers::DragManager$/doDrag()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\DragManager.as:243] at mx.controls.listClasses::ListBase/dragStartHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:9085] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298] at mx.controls.listClasses::ListBase/mouseMoveHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:8822] When I do not add the UIComponent to the canvas, this error does not occur, anyone have any knowledge as to why this happens?

    Read the article

  • What useful macros have you created in Netbeans?

    - by Richard Poirier
    I use Netbeans (nightly build) for Ruby on Rails development and I'm looking to beef up my macros. I've created a few myself: copy identifier: select-identifier copy-to-clipboard paste clipboard over identifier: select-identifier paste-from-clipboard double quote element select-element-next "\"" single quote element: select-element-next "'" But I'm looking for other useful ones and Google is giving me nothing. The record macro feature usually doesn't work too well so I'd rather just "write" the macros myself but I can't even find a reference that lists what commands (like "select-identifier") are actually available. Any Netbeans macro gurus out there?

    Read the article

  • Where to find a unique session ID at design time in .Net WinForms.

    - by Jules
    I've created a custom clipboard because it's not possible to make my whole class map serializable - which is a requirement for the windows clipboard. However, I need to distinguish between users who are using my clipboard through a unique id. Basically, I want to be able identify a person who is sat at one PC with one or more copies of visual studio (or similar) open. How do I do that? ps: This is at design-time. pps: It's not critical that it should work between copies of visual studio. One copy would be fine, or even one design surface.

    Read the article

  • How to disable listbox auto select item when pressing key

    - by tomfox66
    I have a listbox where I want to copy and paste items within that listbox. Copy and paste works fine but everytime I press "Crtl + C" the item starting with the letter C is automatically selected. Can this automatic selection be disabled or am I missing something here Here is the copy and paste method I implemented: private void listBox_Script_KeyDown(object sender, KeyEventArgs e) { if (e.Control == true && e.KeyCode == Keys.C) { int test = listBox_Script.SelectedIndex; Clipboard.SetDataObject(listBox_Script.Items[listBox_Script.SelectedIndex], true); return; } if (e.Control == true && e.KeyCode == Keys.V) { if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text)) { listBox_Script.Items.Insert(listBox_Script.SelectedIndex + 1, Clipboard.GetDataObject().GetData(DataFormats.Text).ToString()); return; } }

    Read the article

  • Is there any way to disable the "double-click to copy" functionality of a .NET label?

    - by DavidCarroll
    This is really annoying. I'm using the label as part of a list item user control, where the user can click it to select the list item and double-click it to rename it. However, if you had a name in the clipboard, double-clicking the label will replace it with the text of the label! I've also check the other labels in the application, and they will also copy to the clipboard on a doubleclick. I have not written any clipboard code in this program, and I am using the standard .NET labels. Is there any way to disable this functionality?

    Read the article

  • What is the quickest way to indent a block of text with spaces for use within a web browser?

    - by ændrük
    I occasionally have the need to indent a block of text with spaces for use within a web browser, for example, when formatting a code block on this site or in a post on Launchpad. So far I've just done it by hand by copying four spaces to the clipboard and then mashing keys really fast: ?, Home, Ctrl+V (repeat) What is the quickest way to accomplish this? Copying and pasting to another program? (Which?) A Firefox or Chrome browser extension? A command to directly modify the clipboard contents? An auto-typing program?

    Read the article

  • ORM Profiler v1.1 has been released!

    - by FransBouma
    We've released ORM Profiler v1.1, which has the following new features: Real time profiling A real time viewer (RTV) has been added, which gives insight in the activity as it is received by the client, in two views: a chronological connection overview and an activity graph overview. This RTV allows the user to directly record to a snapshot using record buttons, pause the view, mark a range to create a snapshot from that range, and view graphs about the # of connection open actions and # of commands per second. The RTV has a 'range' in which it keeps live data and auto-cleans data that's older than this range. Screenshot of the activity graphs part of the real-time viewer: Low-level activity tab A new tab has been added to the Application tabs: the Low-level activity tab. This tab shows the main activity as it has been received over the named pipe. It can help to get insight in the chronological activity without the grouping over connections, so multiple connections at the same time per thread are easier to spot. Clicking a command will sync the rest of the application tabs, clicking a row will show the details below the splitter bar, as it is done with the other application tabs as well. Default application name in interceptor When an empty string or null is passed for application name to the Initialize method of the interceptor, the AppDomain's friendly name is used instead. Copy call stack to clipboard A call stack viewed in a grid in various parts of the UI is now copyable to the clipboard by clicking a button. Enable/Disable interceptor from the config file It's now possible to enable/disable the interceptor Initialization from the application's config file, using: Code: <appSettings> <add key="ORMProfilerEnabled" value="true"/> </appSettings> if value is true, the interceptor's Initialize method will proceed. If the value is false, the interceptor's Initialize method will not proceed and initialization won't be performed, meaning no interception will take place. If the setting is absent, or misconfigured, the Initialize method will proceed as normal and perform the initialization. Stored procedure calls for select databases are now properly displayed as a call For the databases: SQL Server, Oracle, DB2, Sybase ASA, Sybase ASE and Informix a stored procedure call is displayed as an execute/call statement and copy to clipboard works as-is. I'm especially happy with the new real-time profiling feature in ORM Profiler, which is the flagship feature for this release: it offers a completely new way to use the profiler, namely directly during debugging: you can immediately see what's going on without the necessity of a snapshot. The activity graph feature combined with the auto-cleanup of older data, allows you to keep the profiler open for a long period of time and see any spike of activity on the profiled application.

    Read the article

  • Visual Studio 2010 tip: Cut empty lines

    - by koevoeter
    How many times you wanted to move 2 lines by cut and pasting them, but the line you cut last is actually a blank line and your actual code is removed from the clipboard? Visual Studio 2010 has an option that keeps cutting blank lines from overwriting the clipboard. Go and uncheck this one: Tools » Options » Text Editor » All Languages » General » Apply Cut or Copy commands to blank lines when there is no selection Extra (related) tip The (free) Visual Studio 2010 extension Visual Studio 2010 Pro Power Tools contains (apart from a bunch of other handy features) the commands Edit.MoveLineUp and Edit.MoveLineDown to do whatever they say they do and maps them automatically to keyboard shortcuts Alt+Up & Alt+Down. Resharper (not-free) has similar commands for moving lines, by default mapped to Ctrl+Alt+Shift+Up/Down.

    Read the article

  • What is a quick way to indent a block of text with spaces for use within a web browser?

    - by ændrük
    I occasionally have the need to indent a block of text with spaces for use within a web browser, for example, when formatting a code block on this site or in a post on Launchpad. So far I've just done it by hand by copying four spaces to the clipboard and then mashing keys really fast: ?, Home, Ctrl+V (repeat) What is a quicker way to accomplish this, e.g. copying and pasting to another program? a Firefox or Chrome browser extension? a command to directly modify the clipboard contents? an auto-typing program?

    Read the article

  • How secure is KeePassX?

    - by Uli
    I have hundreds of passwords, since I use a different random one for each website/service. They are all generated & stored with KeePassX, which can be synced to different computers and my android phone via dropbox (or ubuntuone). I know the database of KeePassX is secure (at least with a good passphrase). But what about when I am copying the password into the clipboard (where it is stored for 5 seconds)? Can any program running in user-space access the clipboard and store the password? If so, how big of a security risk is this?

    Read the article

  • Strange Behaviour with Unicode Characters in Windows

    - by open_sourse
    Ok, I do not know if this is a programming question, but it certainly is a technical one so I am asking it here. I was working on some internationalization stuff in my PHP code, and in order to ensure that my generated HTML shows up Unicode correctly based on the encoding and stuff I decided to add some Chinese text to my PHP page, which then echoes it into the browser to complete my test case. So I went into google and typed "Chinese", copied the first Chinese text that the search returned (which was ??/??). I then copied it into Notepad++ which is my editor, and to my surprise showed up as boxes similar to [][]/[][]. So I thought the encoding in Notepad++ was messed up and I changed the encoding to UTF-8 and UCS, neither worked. I did it fresh in a newly encoded file, still I got the boxes. The same content when I paste into Google and StackOverFlow (like I did in this posting) shows up correct Chinese! I even opened up Windows Clipboard Viewer and the content is represented in the Clipboard as boxes! I tried pasting it into Windows Explorer address bar and using to rename a file to, but I still get boxes. But it shows up correctly when pasted into my Chrome Browser address bar! Is this a Windows issue? Since I am able to paste it correctly in SO, the data in memory should be encoded correctly right? But if that is the case why does it show up as boxes in the Clipboard Viewer? I am confused here...By the way I am using Windows XP with SP3. (I am asking this question here, even if it is not programmatic, because it is preventing me from running my programming test cases..)

    Read the article

  • Java Copy/Paste org.w3c.dom.Node between two running copies of the same program

    - by Jay
    I have a program that shows a tree representation of an XML file. Using a number of sources online I have Copy/Paste within a single instance of the program working. I am using the system Clipboard. What I need though is to be able to copy a node from one instance of the program and paste to a different instance of the same program. I have tried a number of different options, all resulting in the same behavior. When pasting from within the same application the clipboardContent contains a "transferable" object with the correct data along with an isLocal set to "true". When I perform the copy and then attempt the paste from another instance of the same program running the clipboardContent contains a "flavorsToData" HashMap and "flavors" values, the check for isDataFlavorSupported fails (never hits my custom class that represents the new flavor). I have tried using different values for the requestor object in the getContents() call. Likewise I have tried a few different ClipboardOwners for the setContent() call. Neither seem to change the behavior in any way. I am sorely tempted to convert the node that is being copied back into a textual XML format, and then on the paste convert back to the DOM model, but would rather not if possible. This class is used to define the DataFlavor and transferable object: import java.awt.datatransfer.*; import org.w3c.dom.Node; public class NodeCopyPaste implements Transferable { static public DataFlavor NodeFlavor; private DataFlavor [] supportedFlavors = {NodeFlavor}; public Node aNode; public NodeCopyPaste (Node paraNode) { aNode = paraNode; try { NodeFlavor = new DataFlavor (Class.forName ("org.w3c.dom.Node"), "Node"); } catch (ClassNotFoundException e) { e.printStackTrace (); } } public synchronized DataFlavor [] getTransferDataFlavors () { return (supportedFlavors); } public boolean isDataFlavorSupported (DataFlavor nodeFlavor) { return (nodeFlavor.equals (NodeFlavor)); } public synchronized Object getTransferData (DataFlavor nFlavor) throws UnsupportedFlavorException { if (nFlavor.equals (NodeFlavor)) return (this); else throw new UnsupportedFlavorException (nFlavor); } public void lostOwnership (Clipboard parClipboard, Transferable parTransferable) { } } I define a Clipboard object from the main application screen and then tie in copy and paste handlers for the mouse clicks: During initialization I assign the system clipboard: clippy = Toolkit.getDefaultToolkit().getSystemClipboard(); Copy Handler Node copyNode = ((CLIInfo) node.getUserObject()).DOMNode.cloneNode(true); NodeCopyPaste contents = new NodeCopyPaste(copyNode); clippy.setContents (contents, null); Paste Handler Transferable clipboardContent = clippy.getContents (null); Node clonedNode = null; if ((clipboardContent != null) && (clipboardContent.isDataFlavorSupported (NodeCopyPaste.NodeFlavor))) { try { NodeCopyPaste tempNCP = (NodeCopyPaste) clipboardContent.getTransferData (NodeCopyPaste.NodeFlavor); clonedNode = tempNCP.aNode.cloneNode(true); } catch (Exception e) { e.printStackTrace (); } Thanks!

    Read the article

  • why is my emacs yanking the wrong text?

    - by Josh Knox
    running emacs 22... on ubuntu 9.04, fresh install. When I copy a region of text via C-w (clipboard-kill-ring-save) then yank it back with C-y (clipboard-yank) it pastes random stuff, from some other buffer that isn't even open. It was working fine earlier today and I haven't changed my emacs config. Any ideas why this is suddenly happening/ how to fix it? Thanks!

    Read the article

  • Programmatically trigger a copy or paste in c#

    - by Crash893
    I have a program that I'm working on that register global hotkeys I would like to use that ability to trigger highlighted text or data to be copied to the clipboard and then read from the clipboard into a variable in my program which i will later use in reverse to paste it back out. (example ctrl+1 copys to quque #1 and alt+1 pasts what is in quque 1) thanks so much.

    Read the article

  • How to run unit tests in STAThread mode?

    - by Peter
    I would like to test an app that uses the Clipboard (WindowsForms) and I need the Clipboard in my Unittests also. In order to use it, it should run in STA mode, but since the NUnit Testfixture does not have a main method, I don't know where/how to annotate it... Thanks!

    Read the article

  • Visual Studio line deletion

    - by Sean
    Is there any way in Visual Studio 2003 that I can delete a line without it being copied into the clipboard? There are instances when I want to copy the first line of a block of text and then delete the following n lines but this then puts the last line I deleted into the clipboard, which is very annoying. I have come from a brief keymap background and I could easily do this with Alt-D. And while I'm on the subject, why on earth have MS stopped supporting the brief keymap?

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >