|
How to set the scrollbar of Multiline textbox to the bottom.
eg:
Like chat window, the scrollbar always set to the bottom or the view of the text always to the last entered line.
Regards,
YPKI
|
|
|
|
|
Hi,
make sure the caret is at the end of the TextBox, then call TextBox.ScrollToCaret()
|
|
|
|
|
Why donot you try RichTextbox? It is quite simple to implement this function.
Code as below:
this.richTextBox1.HideSelection = false;
this.richTextBox1.AppendText("asdf" + Environment.NewLine);
Tan Li
I Love KongFu~
|
|
|
|
|
you can force multiline textbox to select and display the last line.
actually, it is similar to realize this function with either multiline textbox and richtextbox
|
|
|
|
|
I'm trying to save some data about controls at runtime and am having a hard time getting the Namespace that the control lives in.
If I'm looking at a form I can just use frm.GetType().FullName and I get back Namespace.FormName.
If I'm looking at a User Control calling ctrl.GetType().FullName only returns the name of the control class. How can I retrieve the missing Namespace data?
|
|
|
|
|
Is it possible? The FullName property will contains the namespace info. Can you paste some relevant code?
Tan Li
I Love KongFu~
|
|
|
|
|
This problem may have been a random bug. Once the machine was rebooted the namespaces began appearing. Weird.
|
|
|
|
|
I have created a windows executable program via a C# VS 2005 project. This is not a published or 'Click Once' project. I also created a setup and deployment project for this application, and built the corresponding "setup.exe" and .msi files for the install. Within this setup and deployment project I created a shortcut to point at the windows executable, and have placed this shortcut in the 'User's Program Menu' special folder.
When I install this application on a PC with XP or Vista operating systems everything appears to go fine, and the shortcut in the user's program menu is created. However, when I click the shortcut it always searches for the ".msi" file used in the installation, and if I have removed the flash drive I installed the application from, the shortcut will not work. I need to delete the shortcut included with the install, and create a new shortcut that points at the installed executable, to avoid this problem.
Does anyone know, or have any thoughts, as to why the shortcut I am installing via the 'Setup and Deployment' project always needs access to the ".msi" file to work? Like I said, I have not published or, at least not intentionally, built this application as a 'Click Once' project.
Thanks...
|
|
|
|
|
What is the target of the shortcut? Make sure its to the exe.
only two letters away from being an asset
|
|
|
|
|
FWIW, the target is fine, it is the EXE. I must have some setting that is forcing the project to act like a click once, published project. But I'm obviously not seeing the forest for the trees.
|
|
|
|
|
You checked the properties to make sure ClickOnce wasn't checked I assume. I've seen this behavior with other apps, it may not have anything to do with yours, it could be a dependency that isn't present. Have you tried on other machines?
only two letters away from being an asset
|
|
|
|
|
Thanks for the responses, but ClickOnce is definitely not checked. I imagine if a dependency was not present then I still would be having problems after deleting and manually re-creating the shortcut in the Program's menu, but everything is fine when the shortcut is manually created.
I've tried the install on multiple machines using XP or Vista operating systems with the same result. Fortunately the installation does not need to be done on very many machines, so I'm going to throw in the towel for the time being and just manually create the shortcut.
|
|
|
|
|
Shame you never got an answer on this one. I have the same issue. I thought I must be doing something wrong, but can't work out what it is.
Did you ever work it out?
Thought it maybe because I made the shortcut to the Primary Output of xyz Project, but your post said you made it to the exe
|
|
|
|
|
Yeah, I did sort of work it out. Turns out that, by default, that is apparently automatically how VS 2005 does its setups; and I do not believe there is an override. So instead I used the 'Orca MSI Editor' tool to modify the installer created by VS 2005 to use the shortcut I wanted. If you are unfamiliar with the tool, google for Orca MSI Editor and you will find some downloads. I believe it does come with the Windows Installer SDK, but you can download just that tool if you do not want the entire SDK.
|
|
|
|
|
|
Are there any differences between these two assignment ?thanks
char com[2]="my text;
string com[2]="my text";
|
|
|
|
|
an82 wrote: Are there any differences between these two assignment ?thanks
char com[2]="my text;
string com[2]="my text";
Not really. They are both nonsense.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
sorry:
char com[2]="my text";
string com[2]="my text";
|
|
|
|
|
I suppose you didn't improve yourself enough.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
an82 wrote: sorry:
char com[2]="my text";
string com[2]="my text";
That's not the problem. I didn't even notice the missing quotation mark.
Both statements are nonsense. It looks like you try to create arrays, but the syntax isn't even close. Look at this:
char[] com1 = new char[3];
com1[0] = 'a';
com1[1] = 'b';
com1[2] = 'c';
string[] com2 = new string[3];
com2[0] = "Hello";
com2[1] = "world";
com2[2] = "!";
And this:
char[] com1 = new char[] { 'a', 'b', 'c' };
string[] com2 = new string[] { "Hello", "world", "!" };
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Nope, they're still nonsense.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
an82 wrote: har com[2]="my text;
Your syntax is incorrect but I think I know what you are asking. Here is the correct syntax:
char com[2] = {'A', 'b'};
You are creating an array which has 2 chars in it.
an82 wrote: string com[2]="my text";
string com[2] = {"Correct", "Version"};
Here you are creating an array of strings, not chars. String type is actually an array of chars. This is an "array of chars of array of chars".
When you create a char array you can store characters in them. In a string array you can store strings (one character can also be a string).
Read about arrays, strings, and chars if you are still confused.
|
|
|
|
|
CodingYoshi wrote: Here is the correct syntax:
char com[2] = {'A', 'b'};
That is a bit closer, but it's not correct.
The correct syntax is:
char[] com = new char[] { 'A', 'b' };
Or in C# 3.0 you can use the shorter form:
char[] com = { 'A', 'b' };
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|