memo

Append text to memo using Win API

流过昼夜 提交于 2019-12-08 09:31:46
问题 I'm trying to append text lines with this code SendMessage(Form1.log.Handle, WM_SETTEXT, 0, Integer(PChar(textLog))); // textLog are some lines eg 'Program started at xxx' etc but it doesnt append, just set new text 回答1: WM_SETTEXT will replace the entire content; either read the current content, append your new text & set the lot or ensure the caret is at the point you wish to append to and add the new text with EM_REPLACESEL . 回答2: It is recommended that you do not use EM_SETSEL or EM

Pimping scalaz Memo

假如想象 提交于 2019-12-04 19:22:46
I like the new scalaz Memo functionality but find it lacks 2 things: 1) it hides the underlying Map, which I need access to--at least a List of all the values, and 2) I want a version that's implemented using a val scala.collection.concurrent.TrieMap, which I read somewhere is preferable than a var Map. I'm not yet an implicit wizard. Is there a way to pimp this Memo class to add versions that support this capability or am I going to have to cut/paste into a distinct, new class? This can be accomplished with the built-in Memo.memo function. Memo.memo creates a Memo instance from a function F =

Export MS Access Memo field and convert Unicode

烈酒焚心 提交于 2019-12-01 14:29:13
I have an Access 2003 database. A table has a Memo field and I'm having issues with getting that data out. Exporting that field to a txt or csv chops that field off (255 characters) Exporting as Excel gives me strange characters for linebreaks Appending to a mysql database via myODBC gives an error about "incorrect string" Using VBA with Scripting.FileSystemObject doesn't work unless you tell it to create the file as Unicode, which is okay, but then I can't get the file converted to something I can import There are Unicode characters in some of my data. It's not a multi-linual database, so the

Accessing form members from another class

只愿长相守 提交于 2019-12-01 01:56:02
The point is to notify the user using the memo when a packet is received/sent in a TCP Client. The old code was extra dumb,I used a Timer that used to add text in the memo since the Timer has access to the form members,lol. The old code: //Memo.Text += txt + "\n"; I played with it today,this is what I've done In Form1's class public string TextValue { get { return Memo.Text; } set { this.Memo.Text += value + "\n"; } } I call the code like that: Form1 myForm = new Form1(); myForm.TextValue = "test asdasd"; The memo modifiers are private ,but that's not the problem. The problem is that no text

Accessing form members from another class

帅比萌擦擦* 提交于 2019-11-30 21:25:08
问题 The point is to notify the user using the memo when a packet is received/sent in a TCP Client. The old code was extra dumb,I used a Timer that used to add text in the memo since the Timer has access to the form members,lol. The old code: //Memo.Text += txt + "\n"; I played with it today,this is what I've done In Form1's class public string TextValue { get { return Memo.Text; } set { this.Memo.Text += value + "\n"; } } I call the code like that: Form1 myForm = new Form1(); myForm.TextValue =

How to intercept (detect) a Paste command into a TMemo?

天大地大妈咪最大 提交于 2019-11-30 08:37:14
问题 How to catch Paste command and change text of Clipboard before that text is pasted into a TMemo, but, after Paste, text in Clipboard must be same like before changing? Example, Clipboard have text 'Simple Question', text that go in the TMemo is 'Симплe Qуeстиoн', and after that text in Clipboard is like before changing, 'Simple Question'. 回答1: Derive a new control that descends from 'TMemo' to intercept the WM_PASTE message: type TPastelessMemo = class(TMemo) protected procedure WMPaste(var