I need to fetch the co-ordinates of word from a multiline textbox in silverlight - silverlight-4.0

I have spent an entire day to implementent functionality like GetRectFromCharacterIndex() with no success. Microsoft has not implemented it for Silveright 4.
I need to fetch the co-ordinates (Start & End) of word of a multiline text box in Silverlight 4. It should be noted that the textbox is wrappable. I am not able to find it since a new line and a wrapped lines are two different thing. I am unable to to find the end of line for a wrapped line.
Is it possible to fetch the exact co-ordinates (It is not index of char in string/textbox) of word in a multiline textbox?
Thanks in Advance.
Regards
Sudhir Kumar

Turns out GetRectFromCharacterIndex wasn't implemented in SL5 either.
The only way you can do this is to implement it manually.
To see example how it can be done, you can look at this answer. Be careful, though, since calculating such thing yourself is usually a performance killer.

Related

User input range for XY graph

I'm a beginner user of labview so bear with me, please. I'm working on a project that takes a data text file with columns and rows as an input. I have the project set up so far to take the data from that file and display it in an XY graph.
I want to add a feature where the user inputs a set of values that represent a range in the x-scale. The program should take those two values and make a new graph (or use the old one, that works too) with the proper scale.
I greatly appreciate your time and help .
Thanks
Edit :
A snippet of the txt file.
The red arrow shows what I tried to use from the help section of labview. Yet I have little to no idea on how to integrate it into my diagram or vet if its the right tool to use.
These numeric values input in the front panel is what I thought could work, but I'm all ears to any suggestions.
You already found the correct property node value :)
You have to connect a minimum and a maximum value to the property node. If you click on the function on the node, you can select the min and max option.
I made this little example for you to see what you need to do.
Property nodes are in genereal very useful as you can set and change so many settings programatically.
A nice feature of LabVIEW: You can drag&drop .png pictures in your Block Diagram. So if you want to test my VI-Snippet, just drag&drop it :)
I hope that I could help you, feel free to ask if you have any more questions.

Avoid printing character vbFormFeed as up arrow

I have a program in visual basic that prints some large reports, sometimes with hundreds of pages. There is a lot of encapsulation here, but it boils down to us using the PrintDocument.Print() command to print the document. When it prints, it prints the form feed characters as up arrows (in windows 10). Is there anyway to get these to print as blanks, and just have them start a new page?
Let me know if you need anymore details. This is my first Visual Basic experience and I'm not sure what info would be useful.
Okay, I don't know if anyone else will encounter this, but I fixed it, so maybe my method will help you. There is a PrintPage event handler that fires off when you are printing, and basically it's just a matter of reading a string up to the form feed character, substringing that off to another string and then printing that other string, then culling it from the original string. Making sure you remove the vbFormFeed character from each page.

Is it possible to resize a DateTimePicker or MonthCalendar Control in VB.net

Essentially I want to re-size my dateTimePicker control to fit its parent container. I have tried to do this both through the Control Editor and programmatically but I simply cannot get the drop down calendar to expand at all. So 2 part question:
a) Is this even possible to do?
b) Is there an easy-to-implement solution to having a good looking calendar that fits its parent field? (i.e. using a data grid or something similar)
Any help or knowledge is greatly appreciated!!!
The size of both objects is fixed and defined by the size of its font. Thus you might change its size by affecting the font size. This works fine with DateTimePicker but does not seem to work with MonthCalendar. After a quick research I have found a pretty curious recommendation on the MSDN forum: "you can consider third party MonthCalendar controls to meet your requirement temporarily".
There are quite a few third-party options (after a really quick search I found this) or you might even create one by your own. I personally haven't ever had any problem with the in-built controls but if the size is so important for you I guess that you would have to search/develop something by your own.
Further recommendation: rely on WPF which does contain a resizable control (DatePicker). I want to highlight here that I don't like WPF at all and that thus this recommendation is because I don't see any other option (inside .NET).

LINQPad: Anyway to make the Dump() results be initially collapsed?

Couldn't find it anywhere (google or stackoverflow).
Is there a way to force Dump()'s output to be automatically collapsed?
Update:
Some more info, to bring more focus to the question.
As mentioned below Collapsing can be done after the output as rendered via keyboard shortcust (Alt+1, Alt+2, Alt+3)
And can rendering depth can be determined by passing an int depth param, but that does not allow to expand the results.
Is there some way to change the CSS formatting? I'm not that fluent in CSS, so this might be the solution.
Why I need this:
What I want is to make the output 'cleaner', and dive in when something of interest show's up.
I'm running a query repeatedly, and don't need all of the output all the time, but still using my human abilities to detect change, instead of coding the detection.
Update: November 2013
As Joe (the author himself!) mentions in the comments, LINQPad no longer has the limitation described.
It is now possible to state 0 and collapse the information after it's rendered.
No, although you can call Dump with a number to force it to display to that nesting depth:
.Dump(0)
You can also use the formatting shortcuts (Alt+1, Alt+2, Alt+3) to collapse the whole display to one, two or three levels.
Another option is to dump to grids. Call Dump(true) or use the toolbar button. Grids show only one level and subsequent levels are shown upon demand with hyperlinks.

I'd like to preview a Word document on form

Update2: For now, I'm considering saving a temporary copy of the document in html format to display it, but this kills my idea to show the user's real time affect on the document. It's just bad practice to re-save at every character input and reload the browser. So, I suppose this may just be impractical for now. I'll keep my ear to this thread for any answers that might arise. Thank you for your help.
Update1: The WebBrowser works for PDF, but not Word Documents for some reason. Instead of displaying in the browser control, it opens the document in word. This is apparently something having to do with file to program association within the operating system, but I'm programming this to work on machines besides my own. Therefore, I'll either need a work around, or a way to change the setting programmatically.
Interestingly, when I right click on a doc file, click Open With, and select Internet Explorer, it opens Word.
Original Question:
I'm writing a VB program that fills in
values within a word document. I'm
utilizing the Microsoft Word 12.0
Object Library as a Reference.
I'd like to provide a scrollable preview pane to my user that is within
the form he or she is using. It
would be even cooler if the user could
edit the document through this pane.
I've done Interop extensively, so I'm
well aware of how to write and edit a
Word document. I just want to put it
into a frame and preview it. I'll
probably try to select around the
document based on what is changing as
the user provides input so they can
see what's being changed and where.
Thoughts?
Thanks
Would the print preview not do this?
Edit: Removed previous answer since it's not recommended by MS.
This article talks about using the WebBrowser control to open OFfice documents instead
http://support.microsoft.com/kb/304643/
Okay, I'm answering my own question, but leveling up those that tried to answer. I've decided that the best solution is to actually open the word document, but keep my form's TopMost property set to True. Then, I can doc my form in the upper right, display the document being edited behind it, and select around to each point being manipulated. This effectively accomplishes what I was after.
Thank you to those that provided answers here. They led me to learn quite a bit of stuff.