|
I have a question about these System Objects. What if the user changes his/her properties in Display Settings while the app is running? Do these colors change?
Quote from MSDN:
"Public Properties:
ActiveBorder: Gets a SolidBrush object that is the color of the active window's border.
ActiveCaption: Gets a SolidBrush object that is the color of the background of the active window's title bar.
ActiveCaptionText: Gets a SolidBrush object that is the color of the text in the active window's title bar. "
To me this would imply that the colors are changing. But then again I have been known to be wrong at times.
-Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
Try to search more in MSDN.
look into Brushes.Black
Good Luck
Alex Kucherenko
|
|
|
|
|
Ahhh, ok... That makes sense.
Thanks,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
|
Alex Kucherenko wrote:
Wrong!
Why?
Alex Kucherenko wrote:
in net we have such classes: SystemPens, SystemBrushes and etc.
Your class does not check is requiered Pen or Brush can be replaced by System version, which are exist as singleton instance for hole application and does not use additional GDI Objects.
Thats exactly what I am simulating...and those singletons DONT exist unless they are used.
leppie::AllocCPArticle(Generic DFA State Machine for .NET);
|
|
|
|
|
Shouldn't this class implement IDisposable? I mean the objective of this class is to create and maintain pens and brushes; these need to be destroyed, right?
-Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
|
Hi,;)
When a webbrowser is embeded in a child window,the browser can not respond to user.What can I do to make the browser work correctly as it is embeded in a single form?
Many Thanks.
|
|
|
|
|
Hi guys...
does anyone know of a way to have the columns in a list view auto adjust to the width of the data in a column?
Right now, i have to manually adjust the column header to see the entire data.
Thanks,
.gonad.
.gonad.
|
|
|
|
|
Hi There !
I am trying to develop a control which will be added to web pages and will allow to make "friendly print".
I have tried to look for something similar and couldn't find anything.
I have found some answers dealing with css, which includes the lines:
img{ visible:none}
It allows me to print only some of the elements.
I want to create header and footer of my own.
I have read this article, which is aproposal of standard for css, which I'm afraid wasn't carried out.
(http://www.pwg.org/xhtml-print/HTML-Version/CSS-Print.html)
@page {
counter-increment: pages;
@bottom{ font-family: Times, Palatino, serif;
font-size: 80%;
font-weight: normal;
text-align: center;
content: "Page " counter(pages);
}
}
Does anyone has any idea what to do ? (without handling the registry...)
|
|
|
|
|
Hey All,
Im looking for some advice. I have written a little thread that will check to see wether a text file has been updated. It compares the time for example. I as wondering, whats the best way to have a thread execute a method every few seconds without completely bogging down my main thread?
Thanks,
Ryan
|
|
|
|
|
Have that thread manage the timer (start it, stop it, etc.). If the file has changed, you can Invoke() a method so that it will run on the main thread.
You might want to check into the FileSystemWatcher. It doesn't work in Win9x/ME, though.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
|
zhyluo2003 wrote:
where is a's memory allocated? in the stack or heap?
Memory is allocated for all objects (primitives too). GC cleans it up. Note: That unlike C, everything goes onto the managed heap, so one can "dynamically" create a valuetype array. MS recommends using classes above structs for performance reasons.
leppie::AllocCPArticle(Generic DFA State Machine for .NET);
|
|
|
|
|
Structs and other valuetypes such as ints and the like are created on the stack, not on the heap.
Thus, the syntax
int x = new int();
is confusing, because it appears the integer is allocated on the heap when it isn't.
To allocate on the heap, it is necessary to use (object) new int(), to box the valuetype as a heap object. It really is just syntactical sugar.
Valuetype arrays are allocated on the heap, but that's because arrays themselves are objects. But unlike object arrays, valuetype arrays contain the values as inlined elements rather than references.
Managed C++ makes it clear by exposing 2 pointers int __box * and int * to differentiate between boxed valuetypes and the stack-based equivalents.
Valuetypes are faster to operate than objects, but passing valuetypes around can involve an expensive copy operation if the valuetype is large, and are not passed by reference.
You can make your program an order of magnitude using valuetypes, but only if the data type truly exhibits value semantics. On the down side, you do lose a lot of flexibility.
Thanks,
Wes
|
|
|
|
|
leppie wrote:
MS recommends using classes above structs for performance reasons.
Any links?
|
|
|
|
|
Boxing is very expensive. Everytime you add a valuetype to an ArrayList for example it gets boxed (and making a typed collection doesnt get rid of it AFAIK). With a class you dont get that. Unfortunately the only place I could find something now, is in the EMCA 335 spec Partition 5
D.3. Type Usage Guidelines
D.3.1. Class Usage Guidelines
• Do favor using classes over any other type (i.e. interfaces or value types)
On the MSDN/C# homepage there is only a very informative article on performance.
leppie::AllocCPArticle(Generic DFA State Machine for .NET);
|
|
|
|
|
struct is a value type, so it should be in the stack.
- Kannan
|
|
|
|
|
here is the code:
struct SA
{
//definition of the struct
}
...
SA a = new SA();
...
where is a's memory allocated? in the stack or heap?
Thanks.
|
|
|
|
|
Can anyone help me in using matlab applications inside c#?
how to access matlab ?
i have tried to add a reference to matlab application COM object , and i found a class MlApp , i used it and found all functions , but when i run the program i have the following exception
"QueryInterface for DIMapp failed"
how can i deal with that?
|
|
|
|
|
As I am new to C# programming in general i am finding it very difficult to accomplish the following.
I have simple widow’s forms program with a text box, button and a list box. I need to be able to enter in a group name into the txt box and have all the users of the group be returned into the list box.
I have been going nuts trying to understand Windows Directory Services etc.
Any help would greatly be appreciated.
Peter
|
|
|
|
|
Hi Every One there:
i have seen a lot of key loggers which record each and every thing which is typed. I need some help in developing this type of application.
if some one have done this sort of work or know about any tutorial over te web then plzz tell me.
Thank you in advance
Best Regards
|
|
|
|
|
I want to make a linkedlabel Datagrid column, when user click on it, it will bring up another form. I think probably I should write my custom column style. Does anyone have an example for it?
|
|
|
|
|
Hi,
I've got a windows form application with a listview control on it. In my list control, I'm going to have some negative numbers from calculations. Does anyone one know how to color a list view item? I'd like to color a subitem in the listview say red, if it's value is a negative number. I'd only want to color certian items, not an entire row in the listview.
Thanks for your help!
|
|
|
|
|
I,ve done it like this, but for the Main item:
<br />
ListViewItem item = new ListViewItem();<br />
item.UseItemStyleForSubItems = false;
item.Text = myValue.ToString();<br />
if(myValue < 0)<br />
item.ForeColor = System.Drawing.Color.Red;
But I think it should work also for a ListViewSubItem
Hope this helps
Roland
|
|
|
|