|
Thanks for your feedback tip! I tried and although the doc of RichTextBoxStreamTypes does not show that it has the Flags attribute set, it compiles and runs without errors!
Unfortunately the results look bad, i.e. are unusable, i.e. it still renders wrong.
But thanks anyway for your time!
--
Affordable Windows-based CMS for only 99 €: try www.zeta-producer.com for free!
|
|
|
|
|
Hi!
What happens when you use Encoding.Unicode.GetBytes(); but RichTextBoxStreamType.RichText ?
The latter is a must, otherwise the RichTextBox will not evaluate the control sequences like \rtf1 and so on.
The correct Encoding for your GetBytes() call depends on the Encoding you used when you created the rawRtf .
Regards,
mav
|
|
|
|
|
mav.northwind wrote:
What happens when you use Encoding.Unicode.GetBytes(); but RichTextBoxStreamType.RichText ?
Already tried that, creates garbage.
mav.northwind wrote:
The correct Encoding for your GetBytes() call depends on the Encoding you used when you created the rawRtf.
This is a very good hint, I will look at this. Thanks!
--
Affordable Windows-based CMS for only 99 €: try www.zeta-producer.com for free!
|
|
|
|
|
Is it possible to put a "Procedure Line Separator" (line between methods) in C# / VS.NET 2003, just line with VB.NET?
I can't find the option and I think this line helps a lot. If it's not possible with VS.NET, maybe it is with an addin?
Thanks!
|
|
|
|
|
I'm making a simple application which creatres controls (labels and pictures) at runtime. When I create a new control, I add it to the Controls member of the main form. When I create two of them and drag the seccond one on the first, it hides behind it. How can I make it cover the first one? Are there any specific ControlCollection methods to to this?
|
|
|
|
|
You mean make them on same location and view them by BringToFront() method?
If so you can add them by this.Controls.AddRange(collection);
and that collectionmust contain the code that makes them at the same location .
That is if i get it ?.
|
|
|
|
|
Hello,
I hope you can help me with this issue. I am trying to build an application in C# that converts text from XML with an XSL to a HTML file and prints it according to some printersettings that can be made by an user interface. This application needs to run as an automatic process, so user intervention is not preferred.
I managed to get the XML+XSL->HTML conversion working with the following code:
public static StringWriter MergeXSL_XML(string xml, string xsl)<br />
{<br />
try<br />
{<br />
XPathDocument xPath = new XPathDocument(xml);<br />
XslTransform xTrans = new XslTransform();<br />
xTrans.Load(xsl);<br />
StringWriter strW = new StringWriter();<br />
xTrans.Transform(xPath,null,strW);<br />
strW.Close();<br />
return strW;<br />
}<br />
catch(Exception e)<br />
{<br />
MessageBox.Show(e.ToString());<br />
return null;<br />
}<br />
}<br />
The XML and XSL are read from a file or database. This is working correct. The string writer contains the information I wanted as HTML. But now the bottleneck, I cannot print the HTML.
On some sites and newsgroups people run a command through the shell that executes the printer option. But this needs a temporary file on the server, but that’s not what I want. Some also use:
<br />
wbElement.QueryStatusWB(SHDocVw.OLECMDID.OLECMDID_PRINT);<br />
But that does not give any satisfying results.
I already managed to place the HTML in the Active X component
<br />
wbCom.Navigate("about:blank");<br />
mshtml.IHTMLDocument2 hDoc = (mshtml.IHTMLDocument2)wbCom.Document; <br />
hDoc.write(html);<br />
The item shows the HMTL, but I cannot request the data later (when requesting wbCom.Document I won’t get my edited document), but that is not the real problem. The real problem is that I cannot parse the document to the printer. There is a print document method in the item:
<br />
hDoc.execCommand("Print",false,0); <br />
But calling it shortly after the placement of the HTML in the document will cause a empty document to be print out. But by pressing a button to start the print will print out a document. I already tried to insert a small sleep, but how long the sleep does not matter, an empty document will be printed.
The thing that I want is that the document can be parsed to a printable document so I can print it with the default print components of C#/.NET. Casting does not work, I tried all the IHTMLDocument* classes to find something useful, but none of them seem to have a usable function to create a printable document for the printer components in .NET. One of the casts I tried:
<br />
MessageBox.Show(hDoc.ToString());<br />
printDialog1.Document = (PrintDocument)hDoc;<br />
printDialog1.Document = (PrintDocument)hDoc;<br />
hDoc.execCommand("Print",false,0);<br />
Another problem is that it seems I cannot change the printer settings, I need to change the default printer settings in windows. For example, I need to change the paper source, I can request the sources via:
<br />
for(int i=0; i < printDocument1.PrinterSettings.PaperSources.Count; i++)<br />
{<br />
MessageBox.Show(printDocument1.PrinterSettings.PaperSources[i].ToString());<br />
}<br />
But I am not able to change them
Can someone help me with this problem?
Thanks in advance…
|
|
|
|
|
I'm trying to double buffer an entire form (i.e. all the controls into one off screen buffer). I've tried using the SetStyles double buffering but that appears to double buffer on a individual control basis and not work at all on the ListView control.
Has anyone done this before?
I'm heading in the direction of overriding OnPaint on the form itself and somehow force each control to draw into an offscreen buffer I created. When that's done draw the offscreen image on screen.
I don't have this working yet but thought I throw this out there incase someone has tried this already or has a better solution.
Thanks.
Kevin
|
|
|
|
|
try this code i got no flickering after using it (pass the function the listview handle)
public enum LVS_EX
{
LVS_EX_GRIDLINES =0x00000001,
LVS_EX_SUBITEMIMAGES =0x00000002,
LVS_EX_CHECKBOXES =0x00000004,
LVS_EX_TRACKSELECT =0x00000008,
LVS_EX_HEADERDRAGDROP =0x00000010,
LVS_EX_FULLROWSELECT =0x00000020,
LVS_EX_ONECLICKACTIVATE =0x00000040,
LVS_EX_TWOCLICKACTIVATE =0x00000080,
LVS_EX_FLATSB =0x00000100,
LVS_EX_REGIONAL =0x00000200,
LVS_EX_INFOTIP =0x00000400,
LVS_EX_UNDERLINEHOT =0x00000800,
LVS_EX_UNDERLINECOLD =0x00001000,
LVS_EX_MULTIWORKAREAS =0x00002000,
LVS_EX_LABELTIP =0x00004000,
LVS_EX_BORDERSELECT =0x00008000,
LVS_EX_DOUBLEBUFFER =0x00010000,
LVS_EX_HIDELABELS =0x00020000,
LVS_EX_SINGLEROW =0x00040000,
LVS_EX_SNAPTOGRID =0x00080000,
LVS_EX_SIMPLESELECT =0x00100000
}
public enum LVM
{
LVM_FIRST =0x1000,
LVM_SETEXTENDEDLISTVIEWSTYLE=(LVM_FIRST + 54),
LVM_GETEXTENDEDLISTVIEWSTYLE=(LVM_FIRST + 55),
}
public class Extended
{
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern int SendMessage(IntPtr handle, int messg, int wparam, int lparam);
public static void SetExStyles(IntPtr Handle)
{
LVS_EX styles;
styles = (LVS_EX)SendMessage(Handle, (int) LVM.LVM_GETEXTENDEDLISTVIEWSTYLE, 0,0);
styles |= LVS_EX.LVS_EX_DOUBLEBUFFER | LVS_EX.LVS_EX_BORDERSELECT;
SendMessage(Handle, (int) LVM.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, (int) styles);
}
}
|
|
|
|
|
Hello all,
I am new to C# and trying to write a program that will strip data from three different reports (2 Excel, 1 Text), then output the three "modified" reports. I can picture the flow of the GUI, but cannot seem to grasp the capture and massaging of the data itself.
Any suggestions would be helpful
|
|
|
|
|
Welcome to c# world!
Your request is very vague. Why not ask a more specific question, like how do I open an excel document in the app? Most things you can find by doing a search of the forums, you would probable find most of the answers you are looking for.
Most here are helpful, if you have specific questions...
Some resources:
Excel: http://www.codeproject.com/csharp/csharp_excel.asp
String handling: http://www.codeproject.com/books/0735616485.asp
Hope these help.
*****************
"We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW
|
|
|
|
|
I have been playing with the different events, but am not sure how to make this happen. I want to select the item currently under the mouse. This would give a highlight effect to the one you are over. Anyone know how to do this?
Thanks in advance.
*****************
"I know how hard it is for you to put food on your family." —GW
|
|
|
|
|
If you've not already found a solution, try looking at the OnMouseMove event. Are you trying to give feedback for any control on a form as the user moves from one to the other or are you trying to do this within a specific control, like a ListView or ListBox?
|
|
|
|
|
Hello everybody,
I'm building a class library and i would like to add summary information to some function/classes, the ones that are shown by the object browser. When I add the summary information it is only available to me in the object browser when I'm working in my library.
I would like to see the same information in the object browser when I add the library to an application.
Can somebody please tell me how to do that.
Regards,
Paul
|
|
|
|
|
Are you using the ///summary
in your code ,if not ,try it.
|
|
|
|
|
I'm sure, so that is not the problem
thanks anyway
|
|
|
|
|
I discovered my problem
It only works in C#. I was trying to add my C# DLL in managed C++.Net. It all work so easy together that I forget this could be a problem. (should have mentioned this, should I?)
I'm still a bit disappointed, but it can rest now
Thanks for the trouble,
Paul
|
|
|
|
|
Is there a application around which could help me convert VB.NET project in to C#?
leo
Kathmandu, Nepal
|
|
|
|
|
|
Our VB.NET to C# converter is Instant C#.
Download the Demo Edition at www.instantcsharp.com
(the Demo Edition is also supported)
David Anton
Tangible Software Solutions
www.tangiblesoftwaresolutions.com
Home of the Instant C# VB.NET to C# Converter and the Instant VB C# to VB.NET Converter
|
|
|
|
|
Is there any sample Tapi3 Application created in c#
|
|
|
|
|
I have developed application in c#. which save data in xml. but i don't want to show xml file to user. so i want to put custom file with custom extention(e.g .abc), and when user double click that file then my application will start and load xml file in my own application. How i can implement this.
(my requirement is like microsoft word. when we double click on abc.doc then microsoft word load abc.doc)
Thanks
|
|
|
|
|
|
How to determine from 10 15 tool bar button that mouse is over which button,and how can we change image item of the button on mouse over event.How to do in Tool Bar.
|
|
|
|
|
Use the Tag property for each button. Then query this value in the form with either with a switch statement or if-else-endif type of construct.
|
|
|
|