NSIS: How to add Items to a listbox control? - listbox

How to add items to a listbox control at run time in NSIS?

Okey I got that:
GetDlgItem $1 $HWND 1200
SendMessage $1 ${LB_ADDSTRING} 1 "STR:$R2"
where R2 contains the string I want to add to my list box.
Ok now can anyone help me with a code to read a file line-by-line till EOF and display this file line-by-line in the listbox. Also the file that I am reading here contains list of filenames and depending upon user selection of listitem from the listbox I want to delete that particular file.

FileRead reads one line at the time (See the docs for a complete example)

Related

How to create dynamic hyperlink using Field Codes in MS-Word?

I am trying to add a hyperlink to a field code in MS-Word, but I want the same field code to populate as part of a search query in the url. More relevant info below:
For Instance, this field code is linked to a form and will populate with a tracking number pulled from an inventory database «TrackingNumber», but then I want to link this generated tracking number into a url query is as follows:
HYPERLINK "https://www.google.com/searchq=«TrackingNumber»"
Is this even possible? And if so, how should I configure?
By default, if you insert a mailmerge field into a hyperlink field, the hyperlinks will all show the first record’s address as the 'Text to display' text, even though the hyperlinks will actually point to the merged targets.
Here's how you can do get a mailmerge to display your preferred default 'Text to display' text instead:
Disregarding mergefield issues for the moment, insert a hyperlink into the document in the normal way, choosing whatever 'Click Here' text you want in the 'Text to display' box.
Select the inserted hyperlink and press Shift-F9 to expose its field code.
Replace everything in the field between '=' and '"' with your «TrackingNumber» mergefield.
Select the field and press F9 to update the display.
In Word 2007 & later, you can make the display text variable also, by following these additional steps:
Position the cursor anywhere within the display text.
Insert a mergefield pointing to whatever data field you want to use for the display text (this could even be the «TrackingNumber» mergefield).
Delete all of the previous display text either side of your last-inserted mergefield (note that this field will likely have updated already).
Execute the merge.
After merging to a new document, use Ctrl-A, F9 to update all fields. Without this, the mergefield hover text won’t update to the correct targets.
Note 1: The above is only for merged output sent to a new document; it does not work with merges to email or print. For merges to email, see: https://support.microsoft.com/en-us/kb/912679
Note 2: Hyperlink fields modified this way are liable to cease functioning once the merge has been executed. Accordingly, it's best to save mailmerge main document before doing the merge and not re-save it afterwards. If you need to make changes to the mailmerge main document, don't make/save them after doing a merge; make/save them beforehand.

Populating multiselect OpenDialog with a series of filenames

I use an OpenDialog with Multiselect enabled to allow more than one jpg file to be displayed on a screen. When the dialog is closed, I iterate through the Files list and create a delimited string of filenames which is stored in a memo field of an Access table.
If the user wants to edit the selection, I want to parse the delimited string value and put the filenames into the OpenDialog and have it displayed in the same way it was when they were first selected, however, the dialog only has one filename in the edit box of the form. When the dialog is closed, only this file is in the files list.
How do I re-populate the Files list? We are using Delphi XE on W7-10.
Also, is it possible to have the list "unsorted"? The files list returns filenames in a sorted order, there is no "sorted" property. I would like to be able to have the user select the files in the order they wish to display them. At the moment, sorting is done in a custom editing form that allows them to be dragged to position. This is written out to the delimited string and written to the table.

Devexpress : Express Printing System - Print contents of 2 cxgrid's

Actually, I never tried this but it's supposed to work judging from some comments I've read. I have two grids: One displays Hotel guests and the other one their former stays (Date from- date to, etc..). Now I would like to be able to print both contents as a single report.How do I add the linked contents of the second grid to my dxComponentPrinter1Link1 ??
In the IDE open your form.
Right click and choose ReportLinks on the TdxComponentPrinter
object.
In the links editor window, instead of clicking the Add button, click the dropdown arrow next to the Add button. Choose Add Composition.
This creates a TdxCompositionReportLink object. There is an Items property which will hold all of the report links you want in the composite report. This will print out as a single report. I can't promise both reports will be on the same page though. I've never figured out how to do that.

Directly modify a specific item in a TKinter listbox?

This is one of those just-making-sure-I-didn't-miss-anything posts.
I have a TKinter GUI in Python 2.7.3 that includes a listbox, and there are circumstances where I'd like to directly modify the text of a specific item at a known index. I've scoured the documents and there's no lb.itemset() method or anything like it. As best I can tell I have two options, either of which would work but just seem kind of klunky to me:
lb.delete() the old item and lb.insert() the new value for it at the same index (including a step to re-select the new value if the old deleted one happened to be selected).
Create a listvariable for the listbox, then use get() and set() on it -- with a pile of replace/split/join acrobatics in between to handle the differing string formats involved.
Is there some simpler, more direct way to do it that I'm missing? Or have I turned up all the available options?
Assuming from silence that there's nothing I missed. I went with option 2 -- the acrobatics weren't quite as complex as I'd thought. I just created a behind-the-scenes list wrapped up in a class; every time I update the list, the class syncs up the content of the listbox by doing a ' '.join on the list then setting the listbox's listvariable to the resulting string.

How to copy work item id in TFS?

I constantly need to copy only the id of the work item, but in VS2010, I could not find an easy way to do that. The nearest thing I find is that I can select an item in the query result grid and press Ctrl + C to copy info and then extract only work item id. Any other easier way? An extension that does just that would be lovely.
If you have the work item open, you should be able to get it by making a macro which copies DTE.ActiveDocument.Name to the clipboard.
On the query, right click on the work item, Copy Work Item shortcut. You will be able to copy and paste the work item id and the Title.

Resources