|
|
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;
|
|
|
|
|
...yes...
Except one may use only one line:
this.label1.Text = "test\ntesting";
...with no extra variable.
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
Thanks. I'll go try it out...
Weiye, Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
Hi there,
What's the best approach to convert a 32byte Char[] Unicode array to
a simple string?
char Name[0]
char Name[1]
char Name[2]
...
char Name[31]
thanks for your help,
stonee
|
|
|
|
|
System.Text.Encoding.Unicode.GetString()
<a TITLE="See my user info" href=http:
|
|
|
|
|
How about this:
string mystring = new string(Name);
just create a new instance of a string using constructor that accepts array as an argument.
|
|
|
|
|
sure, thanks for that!
stonee
|
|
|
|
|
I am building my wrapper classes for CheckBox, ComboBox, Text, Radio, and a couple of others that do not come to mind at the moment. The goal is a disabled control without disabling them. I would like to have them be in a dead state as far as input goes (mouse, keyboard or pasting view clipboard) without them having the appearance of disabled controls. Would be great if the user could select the controls to copy text from or things like that, but absolutely, no changing any data or state until I set a flag.
Basically, I want to lock the controls until a user selects an option to edit.
Anything thoughts?
I thought of overriding the OnGetFocus or OnEnter, but they do not cover every situation.
Rocky Moore <><
|
|
|
|
|
Override TextChanged, Clicked, MouseDown etc. or their properties: Text, etc.
May be it helps.
Hi,
AW
|
|
|
|
|
A.Wegierski wrote:
Override TextChanged, Clicked, MouseDown etc. or their properties: Text, etc.
May be it helps.
Yeah, I was trying to avoid that. Most the items don't even respond until it is too late. Figure I will have to block down in the message pump to avoid any changes.
Rocky Moore <><
|
|
|
|
|
You could try createing a user control from each of them. Inherit from say a textbox and then override the WndProc function. I think that all windows messages go through here. I used it with the toolbar user control I made. You can't override the OnPaint for the toolbar because .net doesn't call it, it is drawn by the OS. I handled the paint message and a couple others from there. It will let you consume the ones you want and pass through the unwanted ones.
|
|
|
|
|
Anyone got any reccomendations for help creation software to work alongside c# ? Cost is a major issue on this one .
Am I the only one forever playing catch up with technology , while all the juicy opportunites keep rolling by ?
|
|
|
|
|