|
How to make form as a model Window???
Thankxxxxxxxx In Advance!!!!!!!!!
Truth Is The Simplest !!!!
|
|
|
|
|
Do you mean modal? Use .Show() or .ShowDialog() depending on your needs.
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
ThanXXXX a lot!!!!
Truth Is The Simplest !!!!
|
|
|
|
|
Hi there,
Does anybody know how I can select the entire contents of a text box from the end to the start? (thus allowing the start to be displayed in the text box, if the text is too long to fit).
Below is (obviously) selecting from left to right:
this.txtName.SelectionStart = 0;<br />
this.txtName.SelectionLength = txtName.Text.Length;
so I need something like:
this.txtName.SelectionStart = txtName.Text.Length;<br />
this.txtName.SelectionEnd = 0;
but Text Box has no SelectionEnd Property...
Thanks!
|
|
|
|
|
I didn't test it but try something like
<br />
<br />
this.txtName.SelectAll();<br />
this.txtName.SelectionStart = 0;<br />
this.txtName.ScrollToCaret();<br />
I know this kind of problems (ever tried implementing syntaxhighlighting in a richttextbox ... well you wouldn't want to use the Selects! you will end using the RTF-code itself ... argh) - so I feel you pain
|
|
|
|
|
Thanks for this CKnig, but no joy
|
|
|
|
|
I cannot reproduce your problem. Specifically, calling this.txtName.SelectAll() outside of the constructor retains the current position of the text within the TextBox. This means that if you are scrolled to the start, then call .SelectAll(), you will still be at the start after the call. If this is not the case for you, please be more specific. If you are scrolling the text or selecting all of it in the constructor for your form, then move that code into the OnShown event for the Form. Good luck,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Thanks Jeff,
this.txtName.SelectionStart = 0;
Correctly sets the cursor position to 0, but when I add:
this.txtName.ScrollToCaret();<br />
this.txtName.SelectAll();
All text inside the textbox is selected, but the cursor position is now at the end of the selection..
Any ideas? Thanks.
|
|
|
|
|
Where in your code are you calling .SelectAll()? Are you calling it prior to the object being displayed? If so, then that is your problem. The GUI state of the textbox stores info about things like where to scroll. On my own computer running VS 2005 with .Net v2.0, I don't see this error at all, unless I make the .SelectAll() call from one of the following locations:
1. Within the constructor of any object that is initially loaded by the form
2. Within the Load() event of any object that is initially loaded by the form
3. Anytime the textbox is not visible If this still does not answer your question, then in your next post give me the stack trace from which you are calling the .SelectAll() method. Good luck,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
hmmmm.. Thanks Jeff,
I'm calling it in the Enter event of the text box..
|
|
|
|
|
hmmm. I missed that one, but mine did finally do the same thing you described. I got it to work how you requested by doing the following:
textBox1_Enter(object sender, EventArgs e) {
textBox1.Select(textBox1.TextLength, -textBox1.TextLength);
} Hope this helps!
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
|
Hi guys,
I need your help. I am not a pro in C# and have stalled with a problem. My application does a bunch of things in the following function and this function is called when a button is clicked. upon clicking and upon execution of these functions my application background stalls/turns white due to I believe memory overloading. Please advice on what I could do to avoid that, I tried using application.doevents() but that causes then my MDI screen to go white Please advice....
public bool ProcessMain(string []psfile,out string sErrMessage)
{
bool rt=true;
string ErrMessage=string.Empty;
sErrMessage=string.Empty;
try
{
rt=CleanBox(out ErrMessage);
if(rt)
{
rt=ParseFile(psfile,out ErrMessage);
if(rt)
{
rt=ProcessBatch(out ErrMessage);
if(rt)
{
rt=ProcessErrors(out ErrMessage);
if(rt)
{
Sameer
|
|
|
|
|
Create a worker thread and run the method from there.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Thank you Justin,
Unfortunately I am clueless about threads, i researched google but can't figure out exactly on how to implement it with my code. Please advice
Sameer
|
|
|
|
|
This article[^] is pretty simple, and straight forward. It has some sample code, with comments. It should be pretty easy to figure out, and then implement for your own needs. Good luck
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
thank you and I appreciate your help.
Sameer
|
|
|
|
|
Hey Csharp'ers.
I hope im in the right thread, so here goes...
Can anyone tell me if there are a certain sequence in witch these LDAP Attributes should be set ??
C - Country
L – Location
O – Organization
DC – Domain Component
OU – Organizational Unit
CN – Common Name
Example: [LDAP://CN=Domain Admins,CN=Users,DC=local,DC=mydomainname,DC=com ] and so on
Because if i call the path above like this [LDAP://DC=local,DC=mydomainname,DC=com,CN=Domain Admins,CN=Users ] (switch the DC and CN attributes) I get an unexpected error.
Do i have to set all the DC attributes last ??? or is there a certain sequence to use
|
|
|
|
|
PawJershauge wrote: Because if i call the path above like this [LDAP://DC=local,DC=mydomainname,DC=com,CN=Domain Admins,CN=Users] (switch the DC and CN attributes) I get an unexpected error.
What is the error?
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
Just unexpected error.
No more information to get...
|
|
|
|
|
Don't cross post in multiple forums.
The list has to be specified in order, starting with the object or container you're working with, then specifying it's container, then that container's parent, and so on, up the chain. Every specifier should be a child of the container to the right of it.
|
|
|
|
|
|
Hi All,
I want to search all text files in a Drive.
here is a code to get subdirectories ,but there is problem in returning static data.
"public Directory [] getDirectories(String strDrive)
{
Directory dir= new Directory(strDrive);
Directory [] childDirs=dir.GetDirectories();
return childDirs;
}
"
ERROR :: can't return static data.(something other)
Regards,
chanzeb chaudhary
|
|
|
|
|
That's because System.IO.Directory isn't a type. You can't create a Directory type variable. It's a static class containing methods.
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
I would like to have multiple instances of a windows service (one for each customer) running on the same server. So far my only solutions have been to change the name in the project installer and rebuild the setup, or use a non-friendly transform file (feels like a hack) in Wise.
Ideally, the setup program should ask for the name of the service and install appropriately. (So I don't have to recompile or re-instruct the installer tech.)
I cant find any way to do it with the built in setup and deployment projects. Does anybody have a similar experience or possible solution?
|
|
|
|