|
No problem ..
Could you try to explain to me what "\Par" is .. is it a line break, or a text value that it is suppose to detect ?
|
|
|
|
|
Hey rick, I don't want to cause any trouble to you... Anyway, "\par" is a linebreak like " " in html. Rich Text Format uses the backslash to start it's control code instead of tags<>. So I have to detect where "\par" is in the document. I believe that this is the only way to read a formated document line by line. I hope you understand... Any ideas if it's no trouble???
Thanks!!!!
|
|
|
|
|
Hi!
There's nothing like this available out-of-the-box. StreamReader.ReadLine() reads until the next occurrance of \n, \r or \r\n, nothing to do about it.
In an RTF document, these line break characters are more or less treated as white spaces, so there's no point in trying to use ReadLine() on an RTF file.
You'd have to write your own method to read until \par , but even then the RTF data will not be well-formed (for example, some closing braces will be missing) and I cannot say what a RichTextBox does with partially invalid data...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hey, thanks for the reply! I thought that readline isn't suitable and that I have to create a method for this. But don't know how... The method should be able to read from a stream in whitch the formated text of the rtf file is loaded and detect \par. For the problems you mentioned I believe I have to live with them... Could you help me out here??
|
|
|
|
|
Dear all,
I've written a method which I call from a thread. The problem is that it opens the form in the method, as it is suppose to, but it closes the form immediately after it opened it. Any hints ?
here's the code :
void ultraGrid1_ClickCellButton(object sender, CellEventArgs e)<br />
{<br />
Thread thread = new Thread(OpenMethod);<br />
thread.Name = "something";<br />
thread.Start();<br />
}<br />
<br />
private void OpenMethod()<br />
{<br />
if (_form == null)<br />
{<br />
_form = new NewForm();<br />
_form.Closed += new EventHandler(_form_Closed);<br />
}<br />
_form.WindowState = FormWindowState.Normal;
_form.Show();<br />
}
Kind regards,
|
|
|
|
|
You calling a UI method on a non-UI thread, look at the Output console. An exception should be waiting for you.
|
|
|
|
|
Is it such that everything related to UI-rendering should be done in UI thread?
|
|
|
|
|
Calling Show requires that the thread be running a message pump (like Application.Run). Replace _form.Show with _form.ShowDialog and it should work fine - ShowDialog is modal and runs its own message pump.
|
|
|
|
|
Hi
I have a c# method that takes as one of its params. I would like to restrict the possible values. I realize that enums would achieve this but I cannot create enums with a string value only integer values
eg
public string ProcessTrade(string value1, string values2)
{
...method only allows value 1 to be A, B or C
and should not use code in the method to do this,
the compiler should catch it
}
calling
string result = ProcessTrade("E","ABC") should complie ok, but
string result = ProcessTrade("EEE","ABC") should not complie
Ideally an emun would achieve this if string enums worked
eg
//this wont work because enums have to have an in value
//but this is what i would like
enum TradeType
{
Equity = "E",
MuniBond = "M",
Treasury = "T",
Agency = "A"
}
If an enum like this existed I could then create the method
public string ProcessTrade(TradeType CurrentTradeType, string values2)
{
Switch(CurrentTradeType)
Case CurrentTradeType.Equity:
….etc etc
}
And it would be called in a tidy fashion thus:
String Result = ProcessTrade(TradeType.Equity,”ABC”)
|
|
|
|
|
There are many ways to do this with an enum, but you may want to take a look at the Description attribute. This[^] is a great article - chock full of yummy enummy goodness.
|
|
|
|
|
I am using a Data class to return data from SQL server
<br />
DataSet tpoDataSet = new DataSet();<br />
command.Transaction = transaction;<br />
command.CommandText = psSqlStatement;<br />
command.Connection = ipoConnection;<br />
adapter = dbProvider.CreateDataAdapter();<br />
adapter.SelectCommand = command;<br />
adapter.Fill(tpoDataSet);<br />
<br />
return tpoDataSet;<br />
Its in a dll which is used across different projects for linking to SQL and has
proven its reliability in the past.
However I am passing a sql string to return information on a table in a database
<br />
"SELECT column_name as colname ,data_type as datatype, " + <br />
"character_maximum_length as CharLen,numeric_precision, " +<br />
"numeric_scale, column_default as defaultvalue , " + <br />
"CASE WHEN COLUMNPROPERTY(object_id(table_name),column_name,'IsIdentity') =1 THEN " +<br />
"'YES' ELSE 'NO' END " +<br />
"as 'IsIdentity', " +<br />
"is_nullable as IsNullable " +<br />
"FROM [" + psTargetDb + "].INFORMATION_SCHEMA.COLUMNS " +<br />
"WHERE TABLE_SCHEMA = 'dbo' " +<br />
"AND table_name <> 'utSqlLog' " +<br />
"AND table_name = '" + tpsTableName + "'";<br />
the problem is with the line
<br />
"CASE WHEN COLUMNPROPERTY(object_id(table_name),column_name,'IsIdentity') =1 THEN " +<br />
"'YES' ELSE 'NO' END "<br />
which is returning 'NO' even if the field is an identity field. If I cut and
paste the query into sql and run it then I get the field values that I would expect!
Help appreciated.
|
|
|
|
|
Hi,
Please let me know if there are any good books to start with plugins for MS office, Outlook, IE etc using C#? I loking into few links on MSDN but wanted to see if anyone has some pointers on it?
Appreciated
Thanks
Vikas
|
|
|
|
|
|
I tried to install VSTO but I have C# 2005 express edition and doesnt support.
Is there anyway I can try VSTO on Express edition?
Thanks
Vikas
|
|
|
|
|
most of the pluging application uses COM as underlying technology , C# make it quite easy to use the plugin in any other applicaiton , there are lot of book avaliable on pluging but most of them uses sample code in C++ or VB, you get the concept from there and can implement the same using C# sementic which are quite simple as compared to COM in C++
Regards,
Sunil Tonger
|
|
|
|
|
In my prohect I have menustrip with sub items.but I have used KeyBoard Hooks in prohect and j't allow Up n Down arrow.I want to collopse menu bar and iterate by arrow.(no mouse even).
If U have any suggestion please help me.
Thanks in advance!
|
|
|
|
|
Hello friends ,
I am facing problem dealing with blob data using C#. can anybody tell me how to read and write data in blob field .
thankin you ...
|
|
|
|
|
|
hi there,
I am trying to read and write .xls file into the database table.
It writes the file successfully and reads as well .. but when I try
to open it after reading it from database it shows that the file is
read only and sometimes it shows that the file is corrupted ...
waiting for your reply ...
thanking y o u ...
|
|
|
|
|
Hello everyone,
Any recommended tutorials or code about how to use C# to implement Windows Service?
thanks in advance,
George
|
|
|
|
|
Google not working for you?
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
|
|
Cool, N a v a n e e t h!
regards,
George
|
|
|
|
|
Hi!
There is a VS add-in.
In it I need to create a user control that would draw icons on pane on the left side of text editor window (like breakpoints) and react to OnMouseOver(like Hint) and MouseDown events
I'd be glad for any help.
(sorry for my English )
|
|
|
|