|
Hi,
May be this is an easy thing for you, I am struggling with this as I am a beginner.I am trying to pass "'" to the javascript.
Example: "Nina's doll"
I must pass this sentence to javascript. I tried like this from C#
test=test.Replace("'","\'");
and also like this
test=System.Text.RegularExpressions.Regex.Replace(test,"'","\'");
If I give something else in the replace function insteadof "\'" it is working.
Please help me.
Thanks in advance
-- modified at 7:18 Tuesday 30th May, 2006
|
|
|
|
|
test=test.Replace("'","\\'");
So close
|
|
|
|
|
Hi,
I (newbie) have come upon the following problem:
I use a multiline text box, and want the scrollbars to show only when they are needed.
If TextBox was inherited from ScrollableControl, this would be easy since the DisplayRectangle Dimensions would be different from the ClientSize - whenever there are changes to the text box, I could check if the DisplayRectangle is bigger than the ClientSize, and then add the scroll bars.
But since TextBox is not inherited from ScrollableControl, the DisplayRectangle is always the same like the ClientSize.
Is there another way to find out the size of the virtual client size (besides calculating it from the number of lines and the height of the font)?
Thanks and best regards,
Christian
|
|
|
|
|
Christian Pothmann wrote: besides calculating it from the number of lines and the height of the font
You have a problem with that?
|
|
|
|
|
Sorry to say this, but - Well yes.
It seems unnecessary complicated. I mean, if I set the ScrollBars property to "vertical" for instance, and put a lot of text into the box, Windows or .NET or whomever will calculate the length of the scrolling "button" automatically, so it knows the size of the virtual window already. Just I don't know how to get it from Windows.
That is, I did not know.
I found a method "GetPreferredSize" which returns the size of the virtual window. Hooray. Took me all morning and I don't know whether it was worth the effort, but at least this detour took me around a lot of .NET.
Best regards
Christian
|
|
|
|
|
hi!
I search about this:
Is there any component or dll. that we can use in our application as tools to help user use this tools to type his/her c# code in c# environment and compile or pars it?if the answer is yes, where can i find it?
plz answer it as soon as possible!
thanks
|
|
|
|
|
Hello!
I got a few problems. Let´s start:
I made a program that runs another (automaticly)...
for example:
< Process p = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = @"C:\Corel\CorelDraw.exe";
p.StartInfo = startInfo;
p.Start();>
As you can see there isnt a computer that can load instantly, so...
I would like to know if there is any function that can tells me when "CorelDraw" is loaded?
I made a "infinite" loop with Thread.Sleep where it checks a lot of time if p.MainWindowTitle is equal to "Corel Draw" (it checks if my program is loaded) or if part of the Title contains "Corel Draw" but I got some bugs... 1 of them is if I start Sleep function just after p.Start() just to wait until my program is loaded, it seems Corel will not load at all and my loop is going to literaly to infinite, the other problem is that I must check the comparison when the program is fully loaded =/
I got a few more questions ...
Does anyone know how to send an automatic command... for example: "Ctrl+A" (select all)
or if I can interact with the Corel... like automaticly select "File -> Import" after that Import a file another folder. ??
Thanks!! (sorry for bad english)
|
|
|
|
|
i use follow functions for loadind my html pages,there are some pictures in my source code of html page , that have relative src ,
when the browser navigate , the pictures didn't show!!!
what can i do??
private void Form2_Load(object sender, System.EventArgs e)<br />
{<br />
<br />
object empty = System.Reflection.Missing.Value;<br />
axWebBrowser1.Navigate("about:blank", ref empty, ref empty, ref empty, ref empty);<br />
}<br />
<br />
<br />
public void html_load(string context,string title)<br />
{<br />
string SourceCode="";<br />
SourceCode="<html><head><title>" + title + "</title></head><body>" + context+ "</body></html>";<br />
mshtml.IHTMLDocument2 doc = axWebBrowser1.Document as mshtml.IHTMLDocument2;<br />
<br />
doc.clear();<br />
doc.writeln(SourceCode); <br />
doc.close();<br />
}
|
|
|
|
|
I'm not sure but this might help:
object path = [[your relative paht]] + "test.htm";
object missing = System.Reflection.Missing.Value;
this.axWebBrowser1.Navigate2(ref path, ref missing, ref missing, ref missing, ref missing);
instead of opening the HTML document as a text file, "navigate2" it.
yours,
pAyAm AssAdi
|
|
|
|
|
hi all,
is it possible to restrict access to some of tabpages of a tabcontrol ?
tabcontrols have attributes like Visible or Enable, whereas tabpages dont have such properties ;(
there is one property IsAccessible. i set this to false but its only not accessible when form loads. if a click on a different tabpage then click back to the previous one i can again see its content.
all i want is to hide or restrict a tabpage not just for a moment but during form is open.
thanks in advance,
bye.
|
|
|
|
|
Use the event "Click" from TabControl.
private void tabControl1_SelectedIndexChanged(object sender, System.EventArgs e)
{
tabControl1.SelectedIndex = 0;
}
This code will select only tabPage0.
|
|
|
|
|
Mehmet Fatih Akbulut wrote: all i want is to hide
TabPage has a Hide method
|
|
|
|
|
I'm using VS.NET 2005, now I try to use the webbrowser control to view the XML file, but this control just show the text value not show the tree format as IE!
How can I make it same as IE ?
Thanks for your help!
Hung
|
|
|
|
|
Hi all,
I need to encryct a configuration XML file. can any one suggest me how to do that.
I thought of doing this one by File.Encrypt(filename) method but it throws the execption "Recovery policy configured for this system contains invalid recovery certificate."
I dont know what it is.
Please tell me how you guys will encrypt the configuration XML
Thanks and Regards,
Srini
|
|
|
|
|
See the example from VS2003 :
C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\QuickStart\howto\samples\cryptography\fileencrypt
|
|
|
|
|
Try this:
http://support.microsoft.com/?id=307010
I believe the error being thrown is because the File.Encrypt(filename) method is using the global encryption scheme for your user account on your installation/set up of windows. For e.g. if you decide to encrypt a physical harddrive or parition on yoru computer a key is generated based on yoru user account. So no-one else can plug your HD into their computer and promptly decrypt its contents. If you do encrypt your HD or folders/files this way it is suggested that you enable the recovery manager in case you lose your login details of which as i understand it is like another user login.
So since you either do not have Encryption enabled or the certificate has expired you are recieving that error. I could well be way off track but i think it has to do with this.
Try that article by MS detailed above. If not just decide what level of security you need and generate your own encryption scheme based on some key you think up.
Darren
|
|
|
|
|
I have problem in C# windows development. For successfull exection of my program I need to refer few DLLs that we have developed. I am able to refer the DLLs in my system and I am able to run the code. But If I copy this DLL to some other systems the reference not exists, even the DLLs are existing in the same directory Hierarchy. I have opened my project file in notepad and checked and I observed that <hint path=""> is missing in those files. Can any body help me to point out what is the problem.
Dinesh Kumar P
|
|
|
|
|
Try to set the all reference properties of "Copy Local" to true. Then you can just copy your DLL to other system.
The problem is probably : your codes are using some DLL from Global Assembly Cache not directly from directory.
|
|
|
|
|
Hi,
I have a image on a MemoryStream and a WebBrowser Control. How can I load this image to the webbrowser control without saving it to hard disk!
Thanks,
Hung
|
|
|
|
|
Hi,
Does anyone now hot to get the name of the network group that I'm curretnly in. "Environment.UserDomainName" works only if the network is with a domain.
Thanks in advance
Plamen
|
|
|
|
|
See this : http://www.codeproject.com/csharp/host_info_within_network.asp?df=100&forumid=146669&exp=0&select=1349731
|
|
|
|
|
I would like to read the content of DataGrid after being updated particular or all rows. But I can read current row only. How to read all rows?.
The code i am using to read current row... DataGrid name - DGField
BindingManagerBase BMB = DGField.BindingContextDGField.DataSource,DGField.DataMember];
DataRow Dr = ((DataRowView) BMB.Current).Row;
MessageBox.show(Dr[0].ToString());
Jey
|
|
|
|
|
You can access one cell of the grid as :
DGField[rowIndex,ColumnIndex]
bye
|
|
|
|
|
hi..
In my application im taking input as a string from user, which is acutually a color name..now is there any way to validate that string wheather it is a valid color or not ?
For ex.
"RED" its a valid color
"REDD" its not a valid color
any help..
Thanks
|
|
|
|
|
You need something to validate it against, what colors are valid? The C# Color class contained ones? or the names of Colors in English?
|
|
|
|