|
half-life,
You need to Invalidate(); the control.
Regards,
Gareth.
|
|
|
|
|
it's not working
maybe i'm doing it wrong??
Here is the code :
<br />
lstwBank.Invalidate(lvi.SubItems[3].Bounds);<br />
and i'd tried the whole control:
<br />
lstwBank.Invalidate();<br />
Have Fun
Never forget it
|
|
|
|
|
Perhaps adding the line of code in bold will help.
<br />
ListViewItem lvi = new ListViewItem(itemsArray);
lvi.UseItemStyleForSubItems = true;<br />
lvi.SubItems[0].ForeColor = Color.Red;<br />
lstwBank.Items.Add(lvi);<br />
|
|
|
|
|
Sorry, not working
strange, where did i Go Wrong
THANKS a Lot anyway
Have Fun
Never forget it
|
|
|
|
|
Maybe you can post all of the relevant code as it is in your program. It would make it easier for others to help you out...
|
|
|
|
|
it is so simple
i've created a listview on an empty form
and did only this:
in the onLoad evnet
i can't figure why it's not working
when i do :
lvi.ForeColor = Color.Blue; the whole line will be in the color
but the the code below will not work!!!!!!
strange
Oh, and...
ListView.View is In Details mode
and i have four columns
thats all :
<br />
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Drawing;<br />
using System.Text;<br />
using System.Windows.Forms;<br />
<br />
namespace WindowsApplication2<br />
{<br />
public partial class Form1 : Form<br />
{<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
}<br />
<br />
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
string[] array = { "A", "C", "D", "E" };<br />
ListViewItem lvi = new ListViewItem(array);<br />
lvi.UseItemStyleForSubItems = true;<br />
lvi.SubItems[2].ForeColor = Color.Blue;<br />
listView1.Items.Add(lvi);<br />
}<br />
}<br />
}<br />
<br />
Have Fun
Never forget it
|
|
|
|
|
Just created a new app, added a listview with 4 columns and set to details view as you said.
Pasted your code and altered the UseItemSytleForSubItems to false and it worked perfectly!
private void Form1_Load(object sender, EventArgs e)
{
string[] array = { "A", "C", "D", "E" };
ListViewItem lvi = new ListViewItem(array);
lvi.UseItemStyleForSubItems = false;
lvi.SubItems[2].ForeColor = Color.Blue;
listView1.Items.Add(lvi);
}
|
|
|
|
|
|
Hi,
I'd like to use the version of the installer-project (set in the project properties) as a general version of the whole application (as defined in the AssemblyInfo.cs). Is there an C#-object, which is able to read the visual-studio properties, in special the version of the installer project?
Thanks!
Ariadne
|
|
|
|
|
In vb.net
Dim strversion As String<br />
strversion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()<br />
MessageBox.Show(strversion)<br />
strversion = System.Reflection.Assembly.GetCallingAssembly().GetName().Version.ToString()<br />
MessageBox.Show(strversion)
|
|
|
|
|
Thanks sathish s!
Your solution shows the version of the actual running assembly.
But my question is related to VS-Enviroment: I need a link to the version of the installer-project property.
perhaps VS has a build-in variable [InstallerProjectVersion] or there is a way to investigate the running VS enviroment to get this version.
Ariadne
|
|
|
|
|
Yes there is a way, but a dirty one: read the file <installer-project>.vdproj
Ariadne
|
|
|
|
|
public abstract class BusinessBase<TYPE, KEY> : where TYPE : BusinessBase<TYPE, KEY>, new()
{
} What is the meaning of where TYPE : BusinessBase<TYPE, KEY>, new() and why it is used ? Will new() creates a new instance of BusinessBase again ?
|
|
|
|
|
Hi Navaneeth,
you can find from here.
link[^]
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Thanks. I have that link already. But explanation in that is not clear enough.
|
|
|
|
|
|
the "where TYPE : BuisnessBase<type,key>"
says that the TYPE-parameter must be a "BuisnessBase<type,key>" object or derived from this.
the "where TYPE : new()" just says that the TYPE-parameter does have an constructor without arguments (default-constructor) - therefore you can create TYPE-objects with new.
If you delete the new() - option you will not be able to compile somthing like
TYPE obj = new TYPE(); so if you need to create TYPE-objects in you class you have to provide the new()-where clause.
|
|
|
|
|
Great. It worked.. Thanks for clearing that. BTW, can you point out some uses of generics other than implementing collections ?
|
|
|
|
|
Well everywhere you have some functionality that is common for more than one object.
Of course the major uses are collections and in most cases you might use interfaces instead of type-parameters but if you keep it in mind you will find plenty of uses.
As an example: imagine you want to implement some sorting-algorithm that is independent of the objects to sort.
You can use the generic interface IComparable<t> to do this.
|
|
|
|
|
|
Collections are certainly the most common use for generics. However, they can be used in a lot of different domains. Take the case of a custom business object that needs to declare a "key". All of your objects derive from an abstract base type whose "key" field is a generic type. This allows you the flexibility of each concrete object to use it's own data type for that "key" field.
Another example is in the .NET Framework itself with the use of EventHandler<T> which allows you to declare an event handler and define it in terms of the EventArgs class that it uses.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
how can i retrieve property name and value of image file which are on summary tab of file property using c# only
|
|
|
|
|
Hi all
I have done this problem in vb.net but i got an error in c#.net.
I got an error as:
e.Item.Cells(2).Controls.add(tb)
I am not getting controls proprty of cell.
where tb is my runtime textbox.
if u have any code pls send me.
Thanks
monika
|
|
|
|
|
Use square brackets in C#
|
|
|
|
|
Hello,
I want to create word files and also want to track changes in WORD from DOT NET. How can I achieve this.
Regards,
Pavas
|
|
|
|