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.
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 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.
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.
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.
<a TITLE="See my user info" href=http://www.codeproject.com/script/profile/whos_who.asp?id=38829>leppie<a>::<a TITLE="Go to all articles written by me" href=http://www.codeproject.com/script/articles/list_articles.asp?userid=38829>AllocCPArticle</a>(<a TITLE="Go to my latest, greatest article!" href=http://www.codeproject.com/useritems/dfamachine.asp >Generic DFA State Machine for .NET</a>);
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.
I thought of overriding the OnGetFocus or OnEnter, but they do not cover every situation.
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.