|
AndrusM wrote: It seems that I need to create 2 color methods in my BO only for getting colors back.
There are still some other options.
1. You could return an array or some other collection with Color instances from the GetColor . The first item could be the fore color and the second the back color.
2. Define a custom struct or class that encapsulates two Color instances and return an object of this struct/class from the GetColor method. In my opinion better than option 1, because this way you can access the components of the return value by name and do not need to operate with anonymous fields of a collection.
3. Circumvent the compile error by passing in objects and afterwards assign them to the properties.
Color foreColor, backColor;
td.GetColors(out foreColor, out backColor);
tableStyle.HeaderForeColor = foreColor;
tableStyle.HeaderBackColor) = backColor;
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
What is the best Code Snippets Manager? I’ve found only this:
1) Total .NET SourceBook
http://www.fmsinc.com/dotnet/SourceBook/index.asp
2) Code Library .NET
http://myweb.hinet.net/home4/s630417/CodeLib.htm
3) Code Warehouse 2007
http://www.xcca.com
|
|
|
|
|
put imagelist control on your form and add images in it as you like. now come in to the list view property using smart tag. and go to the node which u add in listview and select your imageindex property value with ur imagelist control. you can only show images in listview over listnodes
|
|
|
|
|
Sir/Madam
Protected and internal protected can be inherited in the derived classes(I mean it's functions can shared among different classes by typing internal or protected internal before the functions or variables).Then what's the difference between them.
Thanks and regards
Pankaj
|
|
|
|
|
From MSDN (do a google search on "protected internal"):
A class member can be declared as protected using the protected keyword, meaning that only derived types using the class as a base can access the member. By combining the protected and internal keywords, a class member can be marked protected internal — only derived types or types within the same assembly can access that member.
Marc
Thyme In The CountryInteracxPeople are just notoriously impossible. --DavidCrow There's NO excuse for not commenting your code. -- John Simmons / outlaw programmer People who say that they will refactor their code later to make it "good" don't understand refactoring, nor the art and craft of programming. -- Josh Smith
|
|
|
|
|
how to change input language in TextBox as like (Right-to-Left) in MS-Office Word
|
|
|
|
|
err...if it's office so why did you post it in the C# section?
and it's Ctrl+shift (on the right side) for right to left and Ctrl+Shift on the left side of the keyboard for left to right o_O
|
|
|
|
|
How to do this.
When I left click on a button to appear the context menu in the location where is the button.
C#
|
|
|
|
|
Handle the click event, get the position of the button, and then show the menu there.
A better way is to create a button that has a drop menu built into it, given that this is what the button will do.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
How do I do the following:
int i = 0;<br />
for (i = 1; i < 4; i++)<br />
{<br />
if (texBox(i).Text.Length > 50)<br />
{<br />
}
there are text boxes named textBox1, textBox2 etc.
TIA
Glen Harvy
|
|
|
|
|
for(int i = 1; i<4; i++)
{
if(this.textBox1.Text.Length >50)
{
/// do something
}
}
|
|
|
|
|
Nah - that will just do the same thing 3 times to one textBox (viz textBox1).
I want to do one thing on three textboxes viz (textBox1, textBox2 and textBox3).
Glen Harvy
|
|
|
|
|
Ahh.. I misunderstood the question..
|
|
|
|
|
Put references to the textboxes in an array:
TextBox[] boxes = new TextBox[] { TextBox1, TextBox2, TextBox3 };
Now you can address the textboxes by index by using the array.
---
single minded; short sighted; long gone;
|
|
|
|
|
|
Assuming you stick with the naming convention, one way would be to iterate over the controls collection and look for the textboxes by name as you go. You could also just look for all textboxes, no matter what they are named, if you want them all.
foreach(Control control in Controls)
{
TextBox tb = control as TextBox;
if (tb != null && tb.Text.Length > 50)
{
// do something
}
}
The beauty of this approach is you don't need to build any array, there's no code to add if you change the textboxes on teh form.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i have created a usercontrol in .Net and im adding that control from code behind of the webform,i have created some properties in the user controls .How do i access those property from the code behind of my web form?
people laugh at me because they say im different and I laugh at them because they are all the same.
|
|
|
|
|
You would have to declare those properties as Public within the userControl first. Then when you've added the control you can access the properties from the new object once its added.
|
|
|
|
|
As mentioned in the title.
How to get computer current time?
|
|
|
|
|
DateTime.Now gives you an instance of the DateTime structure with the current date and time.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
How can I sort the contents (string) in ListBox or ListView by column like for example the details view in Windows Explorer?
_____________________________
...and justice for all
APe
|
|
|
|
|
Hi, Any One has concpts or sample about building Combo Box with Checked drop down list in C# .
Thanks in Advance.
very Good for this Site
|
|
|
|
|
Listen to the drop down event handler (or through WndProc for that matter), and when the event occurs place your checked drop down control near the combobox if not touching the bottom left corner of the combo box. Exit the method prematurely so that the default combo box drop down does not show.
I may have an example of a control that I have wrote lying around somewhere to post.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
I'm trying to make a simple application that enables easy access to certain folders, bluntly, you click a button, and Windows opens an assigned folder for you. Any hints or tips will be highly appreciated. Thank you.
|
|
|
|
|
Process.Start should take a folder path, and open it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|