|
How do i make a Label control automatically resize itself vertically to show the next line of text? The autosize property couldn't help me as it only resize horizontally, making it extremely long.
Thanks.
Weiye, Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
Hi,
I am a degree student doing my final year project. I am writing a proxy server using HttpWebRequest & HttpWebResponse classes. I managed to redirect the request, and get the response.
But when I am half-way writing to the socket (to pass the content to the browser), I got a System.Net.Sockets.SocketException with message:
"An established connection was aborted by the software in your host machine"
It seems that IE timed out too fast or sumthing. How can I solve the problem?
I am quite new to .NET. Please help. Maybe some of you can tell me some ways to discover reasons for exceptions in .net. msdn library doesnt seem to help...
|
|
|
|
|
viperxp wrote:
System.Net.Sockets.SocketException with message:
"An established connection was aborted by the software in your host machine"
Have a look at the callstack and see what caused the problem. You might need to use asychronous mode.
<a TITLE="See my user info" href=http:
|
|
|
|
|
Thanks man.. I solved the problem.
|
|
|
|
|
Visual Studio.NET is installed or not?
My application needs an assembly which is installed part of Visual Studio.NET.
Thx
Never take a problem to your boss unless you have a solution. This signature was created by "Code Project Quoter".
|
|
|
|
|
Kant wrote:
Visual Studio.NET is installed or not?
Ermm, look for it In the registry....
<a TITLE="See my user info" href=http:
|
|
|
|
|
leppie wrote:
look for it In the registry....
Duah... Registry in the .NET world!!.. I thought of using it,
But I thought MS would have created another namespace to check this kinda of stuff.
"Our default today is to assume functionality needs to go cross-platform instead of assuming it doesn't (and then later reluctantly moving it when necessary). I consider this cross-platform issue a disease within Microsoft....This is the wrong approach. We should be asking for specific innovations to restricted to Windows."
James Allchin, Microsoft Senior Executive, e-mail from February 1997
This signature was created by "Code Project Quoter".
|
|
|
|
|
Kant
What is it you are trying to check for? If you are using an assembly that is included in VS.NET are you sure you are allowed to use that code in your projects as there is licensing issues there...
I'm just curious!!
Shaun
|
|
|
|
|
IrvTheSwirv wrote:
I'm just curious!!
Naa...It's just simple checking I want to do. The app requires the Microsoft.Mshtml.dll Primary Interop Assembly which is installed as part of VS.NET install. So instead of crashing the app, throw message to the user informing that VS.NET required to run my app.
Anyway I am cheking like this :
private bool LookupVisualStudioDotNet()<br />
{<br />
string strRegKey = "Software\\Microsoft\\VisualStudio\\7.0";<br />
<br />
Microsoft.Win32.RegistryKey oRegKey = Microsoft.Win32.Registry.LocalMachine;<br />
Microsoft.Win32.RegistryKey oVCDotNetKey = oRegKey.OpenSubKey(strRegKey);<br />
<br />
if(oVCDotNetKey == null)<br />
{<br />
oRegKey.Close();<br />
return false;<br />
}<br />
else<br />
{<br />
oRegKey.Close();<br />
return true;<br />
}<br />
}<br />
....<br />
....<br />
if(false == LookupVisualStudioDotNet())<br />
{<br />
string strMsg = "This application requires Microsoft.Mshtml.dll Primary Interop Assembly." <br />
+ "\n\r" + "Visual Studio.Net installs this in Program Files\\Microsoft.Net\\Primary Interop Assemblies"<br />
+ "\n\r" + "This application can NOT proceed further. It will be closed.";<br />
<br />
MessageBox.Show(strMsg, "Visual Studio.NET not exists", <br />
MessageBoxButtons.OK,<br />
MessageBoxIcon.Error);<br />
<br />
return;<br />
}
Never take a problem to your boss unless you have a solution. This signature was created by "Code Project Quoter".
|
|
|
|
|
Been looking for the info on how to create 'copy' and 'paste' feature for selected cell ranges for datagrids. So far, no luck.
Generally, datagrids don't have the features, except row selections and single cell copy/paste. I want to be able to 'copy' or 'paste' (ie. Ctrl C or Ctrl V) on the *cell ranges*. How do I do that? sample codes will be appreciated.
If my question is vague, please let me know. Thank you.
sleepycat
|
|
|
|
|
Using the standalone version of visual C# .NET:
I'm writing a game. In my solution workspace I have 2 projects - the actual game and the map editor. I want the two to be able to share classes (as in code - not run time instances). That is if I write a class in the game project I want to be able to use it in the map editor. Im kind of new to C#, coming from java and c++. In java I would just jar the classes I wanted at compile time and put them in my classpath. How can I do this in visual C#? I think I need to make a .NET assembly, but Im really not sure how to do that.
Thanks for any help
Dave Ratti
|
|
|
|
|
dratti wrote:
How can I do this in visual C#? I think I need to make a .NET assembly, but Im really not sure how to do that.
AFAIK the standard version does not have that wizard, but just create a new windows form or console app, and remove the main method, and change the project property to compile to Class Library.
<a TITLE="See my user info" href=http:
|
|
|
|
|
|
You can make a dll library that holds the shared classes and you can access those classes from any project you want by including a reference to that dll project.
To add such a project to your solution right click the solution in the Solution Explorer and select Add --> New Project and select Class Library and create a new project somewhere. Then to add references to that library and to make dependencies right click on the projects you want to set the dependency on and click dependencies. Then click the checkbox in front of the dll library and it automatically adds references to that poject and you can use those classes that you put in the dll library by just adding a: #using dllNamespace directive in the files you want to use it.
|
|
|
|
|
The application was built using .NET 1.1 which if not present will show the error above. You can get around this by using a .config file, but it is a PITA to write.
If you have VS.NET 2003 you can have the .config file generated by telling VS.NET to use .NET 1.0 for that project (IIRC it is at: Project Properties, Framework Version).
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
Valeria
You can get it to run on the machine by installing 1.1 of the .NET framwork redist.
Shaun
|
|
|
|
|
Only if you need to build them on the machine in question. If all you want to do is install and run your app then no, VS 2003 is not neccessary!!
Shaun
|
|
|
|
|
Hi,
If anyone can, please help me with this:
How do I need to set the ScrollBar.LargeChange value so that the size of the scrollbar is proportional to the visible area of my control?
My control has an invisible part (it`s bigger than the clientRectangle) and I need a horizontal scrollbar to scroll the contents of my control. I need the HScrollBar Gripper area width to be proportional to the ClientRectangle.Width of my control in comparison to the entire width of the control (the invisible part too). I know this has to do with the LargeChange property of the ScrollBar but it doesn`t work. I tried something like this:
this.hScrollBar.LargeChange = hScrollBar.Maximum * (CilentRectangle.Width/WholeWidth);
If anyone has another idea please reply to this post.
Thanks!
|
|
|
|
|
Iulian Serban wrote:
(CilentRectangle.Width/WholeWidth)
This is likely to yield 0 unless the WholeWidth is less than ClientRectangle.Width because you are performing integer division. The correct way is to convert the three values to floats, then convert back to an int to assign to the LargeChange property.
hScrollBar.LargeChange = (int) ((float) hScrollbar.Maximum) * (
((float) ClientRectangle.Width) / ((float) WholeWidth)
); HTH,
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
Hi James,
Yes I know I have to do those conversions but if I had put them all in my post nobody would even consider looking at the formula there . I debugged the code and it returnes the proportion I want but it`s not the corect formula to set to the LargeChange.
Thanks for replying,
Iulian
|
|
|
|
|
Ok, now that I think about it the code you posted won't do what you want.
Instead you should just set LargeChange to ClientRectangle.Width, and set the Maximum to WholeWidth. The framework takes care of setting the gripper to a proportional size.
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
Ok, I figured it out bu doing some testing using a scrollbar and setting the largechange to diferent values and I noticed this too.
Thanks for replying anyway,
Iulian
|
|
|
|
|
Anyone know how can i display muti line text in a Label? Using MFC CStatic, i used to use "\n" to indicate next line of text but somehow this doesn't work for Label.
Anyway out?
Weiye, Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
There are (at least) two methods.
- Open notepad.exe and type your caption including line breaks. Copy the text and paste into the text property of your control.
- Go into the code module for your form and find the
InitializeComponent() method (you know, the one that says: Do Not Modify on pains of excommunication or something). Find the place wherein the label code section is and modify the text property, inserting "/n" where appropriate. Don't worry, some modifications are acceptable; however, save often and make small changes to catch any that kill the designer's ability to figure out what is going on.
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
char it = Convert.ToChar(10);
this.label1.Text = "test" + it + "testing";
that will do a multi line label
switch(twinsOnWay)
{
case ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
break;
|
|
|
|