|
If your textbox is indeed multiline then that should work. I would try to run something like this;
string strTextType = txtMulti.TextMode.ToString();
If strTextType is not MultiLine then that is your problem. Other than that I can't think of much else.
Regards
|
|
|
|
|
you should set
textBox1.Multiline=true
then it would be ok.
|
|
|
|
|
You have to use "\r\n" in a TextBox and "\r\n" or "\n" in a RichTextBox .
Or use Environment.NewLine .
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi!
txtBox.Text = "SOME TEXT" + Environment.NewLine " TEXT IN NEW LINE";
|
|
|
|
|
Hey everyone. I saw this great article on this website in regards to disabling options in a drop down.
http://www.codeproject.com/aspnet/disableListItems.asp
Great article but I am not sure how to implement it in my code. We have a web based application written in C# with a SQL database and I was trying to disable one of the options in a drop down menu. Here is the code that I have that loads my drop down,it gathers the information from the database but I am in the dark on how to do what the article was telling me to do..
ARBilling.ARUtilities.SetCodeDropDownListDataSource(ref InsurancePolicyStatus,Billing.WebServiceProxies.CodeType.InsurancePolicyStatus);
InsurancePolicyStatus.DataBind();
InsurancePolicyStatus.Items.Insert(0, new ListItem("-- Select --", "-1"));
|
|
|
|
|
Hi!
I think using the forum of the article you mention for this question would be more appropriate.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hello,
I'm wondering why the following code is accepted by the compiler but there's no effect in run-time.
Set browser url to about:blank at design time & make button1 font a little big then...
private void button1_Click(object sender, EventArgs e)
{
webBrowser1.Document.Body.InnerHtml = "Test only";
}
private void button2_Click(object sender, EventArgs e)
{
webBrowser1.Font = button1.Font;
}
Why it's not working?
Your help would be greatly appreciated.
THANKS.
|
|
|
|
|
The Font property is documented to "not have any meaning on this control". In other words, you're setting the Font on a WebBrowser object, when it doesn't do anything.
Documentation[^] on WebBrowser.Font.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi, i have 2 questions
1. Does regex create new instances of objects?
2. Can i replace the String.Substring expression with a regex expression? if so how?(an example would be useful)
Thanks for your intrest
|
|
|
|
|
1. That depends on what you mean.
A RegEx can for instance create a collection of match objects, where each match contains a collection of Group objects, which all contains a copy of part of the string.
2. There are many ways of extracting information using Regex. Here is a piece of code that I used just recently:
return Regex.Match(_message, "\r\nPage: (.*?)\r\n").Groups[1].Value;
It finds a line that starts with "Page: " and gets the rest of the line.
---
b { font-weight: normal; }
|
|
|
|
|
You can use Regex as a more heavy duty way of getting substrings.
The following code will replace whole words wich starts with the letter P.
in the provided example strOnj would end up equalling "Some Sentence to be seperated"
string strObj = "Some Sentence to Parse";
strObj =Regex.Replace(strObj,"P[a-zA-Z]+"," be seperated");
|
|
|
|
|
hi
i want to create trial version from my app and after it was Expired, end user can't restore windows and use it again. How to do ?
thanks ..
|
|
|
|
|
You can add an entry in the registry which consists of the date of installation and the expiry date.
You can check this value when the app starts if the date has reached just delete the registry entry and the app should not be executed if the registry entry is not present.
Hope that works for u.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
The registry entry will have to be created every time you install the application, so after expiration you'll just have to reinstall to get another trial period.
It'll also be saved if you create an image of your windows after installation.
And there are tools out there that can easily track all modifications done to the registry so you can see which registry key is being created.
I'm afraid there is no really watertight way to achieve this when only a single computer is concerned (i.e. without some sort of online activation).
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
If you dont mind using a commercial tool, take a look at CryptoLicensing
It can limit licenses to N number of days.
|
|
|
|
|
I create a class file dynamically and save it on the file system in a class.cs file.
How can I load that file as a class object and bind it to PropertyGrid?
Thanks.
|
|
|
|
|
You'll have to dynamically compile your generated class file (take a look at the Microsoft.CSharp and System.CodeDom.Compiler namespace), load the generated assembly and create an object of your class using Activator class.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I guess you would have to compile the class into an assembly first. Then load the compiled assembly and create an instance of the class and then bind it to the propertygrid.
If you need details, just ask.
|
|
|
|
|
I need details please .
|
|
|
|
|
I can not figure out why the Page_Load is fired twice. Searched every where. Microsoft support says bug with smartnav but we are not using smartNavigation.
Can anybody help me resolve this mystery.
Thanks
-- modified at 17:36 Thursday 12th October, 2006
|
|
|
|
|
Doing any Server.Transfers or such within the page that you might be redirecting back to itself .
I would actually step through the breakpoint of the Page_Load as it enters it for the first time. From there, see where it goes...it might be there is something in your code producing your problem.
|
|
|
|
|
I've written a Service. OnStarts starts a new Thread which will periodically perform some action. Everything works as expected. The only problem is, that the action which should be performed is, goes like this:
ProcessStartInfo psi = new ProcessStartInfo(sFilePath, sArguments);
try
{
Process.Start(psi);
}
catch (Exception e)
{
}
Something goes wrong here, because the process is not started and an exception is not thrown either. Can somebody please tell me why? Does it have to do something with the service interacting with the desktop? If so, how can I allow this programatically?
I hate to say it, but it is urgent...
Thanks a truckload in advance!
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
Well, a windows service runs under the 'System' user account. It could be related to that. My best suggestion is to startup the service and then attach to the process using Visual Studio and debug it. Just remember to build the debug version of the service, install it, and start it.
It can be found from 'Debug' -> 'Attach to Process'.
or you can include this line into your code right before you start the process.
System.Diagnostics.Debugger.Launch();
That should do it.
|
|
|
|
|
hi andrew,
first of all, thanks for your reply. I've attached the debugger. here is what I found out so far: the process is actually started but not visible for some reason. I can see it in the task manager. I guess it has something to do with allowing a service to interact with the desktop. I'm gonna google on this one.
If somebody knows how to allow a service to interact with the desktop, please let me know.
many thanks in advance!
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
There was actually a question just a few threads below yours that asked that very same question.
http://www.codeproject.com/script/comments/forums.asp?msg=1709786&forumid=1649#xx1709786xx[^]
Though, I would suggest allowing the service to interact with the desktop as it would be a security hole. Using remoting or some other form of interprocess communication would be best...
I would almost suggest an old school approach to having a process running in the background for a user - the startup menu. You could have the process started when the user logs in and begin minimized (use a parameter for such) and remain in the icon tray. From there, the process would be able to poll events and interact with the user with less risk of security issues.
Just a thought. Good luck.
|
|
|
|