|
Copy project B's folder to your solution folder, and in Visual Studio, open the solution explorer, right-click the solution, and select "Add Existing Project".
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
It should be noted that some references may be lost during this process and they may have to be added again. If you add project A to the solution and it references project B, then you add project B to the solution, project A may lose its reference to project B (in which case the reference can simply be added again).
|
|
|
|
|
You might want to look into using some kind of source control so that all of you can work on the same project at the same time.
Subversion[^] is a free and good alternative.
Good luck
|
|
|
|
|
Open the fist project in C#, right click the solution and then select Add -> Existing Project, and then add the second project in your solution.
Next, add a reference by right clicking the first project->Add reference, go in the Projects tab and select the second project.
My signature "sucks" today
|
|
|
|
|
What i'am used to is to make one solution with one project per layer
so:
OurSolution
-project.BO
-Project.DAL
-Project.BLL
-Project.GUI
if you allready have the csproj files you can just add them to the new solution
and it is also a good idee (as someone else mentioned) to put it under source control, like svn.
|
|
|
|
|
in windows vista and windows 7 the splitter control used in explorer windows doesnt draw the "hatched line" when it moves instead the controls (listview and treeview) automatically resizes immediately, i want the splitter control in .net to behave like that but cant really figure out how?
heres a pic of the hatched line: http://sv.tinypic.com/view.php?pic=2qa8izk&s=6[^]
|
|
|
|
|
Hi,
I've been looking into the internals of SplitContainer, using .NET Reflector; it seems like a live SplitterMoving isn't supported at all. My guess is you need to (create and) use another Control if you want live splitter movements.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
thanks for your reply, but i think ive fixed it.
the solution is pretty ugly but it works, all i did was overide OnSplitterMoving and set the Splitter.SplitPostion = sevent.X or sevent.Y and then just invalidate the splitter. also invalidate OnMouseDown and OnMouseUp to get rid of the hatched line which showed up until the mouse was moved.
|
|
|
|
|
Very good. Sounds like that logic too deserves to be hidden into a specialized SplitContainer.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hi,
Your fix mentioned in the response to Luc prompted me to look into this again. I'd given up once before as I had got nowhere fast.
The trick is to disable the default handling of the splitter by cancelling the SplitterMoving event. Once that is done the splitter position can be set explicitly in the MouseMove event. Redrawing is automatic and no invalidation is required.
This is what I have
private Boolean mouseDown = false;
....
splitContainer.MouseMove += SplitContainer_MouseMove;
splitContainer.MouseDown += SplitContainer_MouseDown;
splitContainer.MouseUp += SplitContainer_MouseUp;
splitContainer.SplitterMoving += SplitContainer_SplitterMoving;
....
private void SplitContainer_MouseDown(object sender, MouseEventArgs e) {
mouseDown = true;
}
private void SplitContainer_MouseUp(object sender, MouseEventArgs e) {
mouseDown = false;
}
private void SplitContainer_SplitterMoving(object sender, SplitterCancelEventArgs e) {
e.Cancel = true;
}
private void SplitContainer_MouseMove(object sender, MouseEventArgs e) {
SplitContainer sc = (SplitContainer)sender;
if (mouseDown) {
if (sc.Orientation == Orientation.Horizontal) {
if (e.Y >= 0) {
sc.SplitterDistance = e.Y;
}
} else {
if (e.X >= 0) {
sc.SplitterDistance = e.X;
}
}
}
}
Alan.
|
|
|
|
|
Hi,
First of all I think it's important to point out that my goal here is to create the image of 1 line of vertically centered text like you would find in the windows 7 calculator. My thought was to make 2 lines in the richtextbox, and on the 2nd line I would put the text. However when I do this it just doesn't show. I have checked the font color and it's black. Also multiline is true. Here is my code. Maybe I am missing something.
richTextBox1.Lines = new string[2];
richTextBox1.Lines[1] = 111;
The 111 never appears in the text box and the value of richTextBox1.Lines[1] never even changes.
|
|
|
|
|
Hi,
rtb2.Lines=new string[] { "line 1", "line 2", "line 3" };
works just fine. You should work out the difference yourself!
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
I changed it to the following code and it worked so I guess I would like to know who I can set the whole array but I can't change individual items within the Lines array. I didn't see that it was read only and anyways if it was it wouldn't compile. To me it doesn't make sense.
richTextBox1.Lines = new string[2] { "", "111111" };
|
|
|
|
|
After reading the documentation (you should try that, they really make an effort to explain things), I come up with:
rtb2.Lines=new string[] { "line 1", "line 2", "line 3" };
string[] lines=rtb2.Lines;
lines[1]="new line 2";
rtb2.Lines=lines;
and that works too.
BTW: I'm not saying it is the most efficient way under all circumstances...
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
so what is the most efficient way in your opinion?
|
|
|
|
|
I wonder what the type of 111 might be?
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Console.WriteLine(111.GetType().ToString()) gives System.Int32
Pretty obvious, I'd say.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
How to make TabPage in TabControl invisible?
TabConltrol1.TabPages(0).Visible=False ;
|
|
|
|
|
The tabs in a TabControl are part of the TabControl, but not parts of the individual TabPage controls. Members of the TabPage class, such as the ForeColor property, affect only the client rectangle of the tab page, but not the tabs. Additionally, the Hide method of the TabPage will not hide the tab. To hide the tab, you must remove the TabPage control from the TabControl.TabPages collection.
For reference, have a look here.
My signature "sucks" today
|
|
|
|
|
Hello
Can one access methods of a derived class?
e.g.:
public class GameObject { ... }
public class Chest : GameObject
{
public void OpenChest();
public void CloseChest();
}
GameObject chest = new Chest();
chest.OpenChest();
It seems the only GameObject members that appear are those from the base class GameObject.
The methods from Chest are apparently not accessible by polymorphism context.
You can only access Chest's methods by explicitly casting my GameObject type (chest)
to a Chest type, i.e.:
(Chest)chest; chest.OpenChest();
Is there any other way to do this other than casting it explicitly to a Chest type?
I would like to know the reasons why the compiler works this way.
Thank you.
|
|
|
|
|
Because you have declared chest as a GameObject, it can hold a GameObject or any item derived from GameObject.
But because you declared it as a GameObject, the compiler assumes it is the most basic of the control family, and will only allow you to access the GameObject methods, properties etc.
If you had declared it as a Chest, you could access all the chest methods.
Think about it:
public class GameObject { ... }
public class Chest : GameObject {...}
public class TresureChest: GameObject {...}
...
public void PlayWithObject(GameObject go)
{
...
} You can provide a GameObject, Chest, or TreasureChest as a parameter to PlayWithObject, but the compiler does not know what type go will end up being. If it allowed you you use methods from Chest, and you handed it a TreasureChest, what would happen?
Instead, you have to provide runtime checking:
Chest ch = go as Chest;
if (ch != null)
{
ch.OpenChest();
}
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
You might want to look at the new modifier.
My signature "sucks" today
modified on Tuesday, May 25, 2010 12:25 PM
|
|
|
|
|
CsTreval wrote: Is there any other way to do this other than casting it explicitly to a Chest type?
Yes, IF those methods also exist as part of the base class. For example:
public class ABC
{
public virtual string DoIt()
{
return "ABC";
}
}
public class XYZ : ABC
{
public override string DoIt()
{
return "XYZ";
}
}
ABC a = new XYZ();
string str = a.DoIt();
Also, you can technically use reflection to access the methods of any class without even knowing the name of the method. However, that is an advanced topic and not likely what you are looking for.
|
|
|
|
|
Thanks, I already know that topic. I do have some years of programming experience and theory, though. OO (2), Java(3), VB .NET(2), C#(2). Well, I've heard in the past that reflection is not recommended to use since it would not be ideal OO. I think I will do just fine with Chest ch = new Chest(). I didn't realize before that Chest can have GameObject's properties etc. However, why can't you do
Chest ch = new GameObject ? I know the reason but I don't know precisely why.
|
|
|
|
|
Here's some invalid C# for you:
Duck d = new Animal();
d.Quack();
d = new Cat();
d.Quack();
Does that clear things up?
|
|
|
|