|
I want to change the look of Up and Down buttons in NumericUpDown control with some images, I know one way is to override OnPaint event but I could not find any example. Does anyone know good example of this?
Mazy
"This chancy chancy chancy world."
|
|
|
|
|
Hoo Hoo! That's not an easy one. NumericUpDown is a composite control, it contains a text box and a button box - but it doesn't make either public. You can get at the contents (I believe, I've never tried) with reflection, but to be honest, you would be relying on class internals that you have no guarantee will remain the same. I.e. your code may work today, but tomorrow...
A better solution would be to create your own custom control that looks the way you need, including your own up/down logic and text box. Would be more reliable, and probably quicker to develop, too.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Yes, after more investigation, I came into same result. Thanks for reply.
Mazy
"This chancy chancy chancy world."
|
|
|
|
|
Welcome - good luck!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
I want to define the ConcurrentQueue size -
I mean that if the ConcurrentQueue_.count is bigger then X then the last item in the queue need to be out.
Is it possible ?
Thanks.
|
|
|
|
|
hi guys
how to copy control with relative code?
such as a button with click and double click ,mouse move and etc
thanks a lot
|
|
|
|
|
behzadcp wrote: how to copy control with relative code?
Are you asking how to create a custom control based on other controls with the little code as possible?
|
|
|
|
|
I seen a struct on a pInvoke.Net
[StructLayout(LayoutKind.Sequential)]
public struct PROCESSENTRY32
{
public uint dwSize;
public uint cntUsage;
public uint th32ProcessID;
public IntPtr th32DefaultHeapID;
public uint th32ModuleID;
public uint cntThreads;
public uint th32ParentProcessID;
public int pcPriClassBase;
public uint dwFlags;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=260)] public string szExeFile;
};
PROCESSENTRY32 pe = new PROCESSENTRY32();
pe.dwSize = (uint)Marshal.SizeOf(pe);
I know i have read somewhere here that strut should be intalized inside constructior or it will couse problems. Does that applay to WinAPI too?
Edit: Forgot code tags
|
|
|
|
|
Inside what constructor? The only thing you have to worry about is establishing the size of the struct so that the WinAPI knows how big the object is. The only concern about initializing it is what scope the resulting object has.
.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
|
|
|
|
|
i see, so it doesn't have struct problems like c#
i know for size iz has to be:
public struct Size
{
public Size(int x, int y)
{
X=x;
Y=y;
}
public int X;
public int Y;
}
And it shoudln't be used as:
Size size = new Size(1,1);
size.X = 5;
size.Y = 10;
|
|
|
|
|
Saksida Bojan wrote: strut should be intalized inside constructior
Correct, however every struct has a default parameterless constructor that cannot be overridden. If you are creating your own constructor (with parameters) then you would need to need to initialize every field inside that constructor.
Nothing to do with your question, but *sometimes* when PInvoking you can interchange int /uint . The size of the struct you have declared will be 296 bytes on a 32 bit system and 300 bytes on a 64 bit system. This is well within the range of an int so you can safely declaredwSize as an int (still 4 bytes) and get rid of the cast to uint when calculating the size.
|
|
|
|
|
If you don't explicitly initialize the fields in a struct (such as when using the default ctor) all fields will be initialized to their default value (0 , 0.0 , null , etc)
That's not really a "problem", and it's well-defined behaviour. Even if you have a huge struct like this.
The semantics of the default ctor are described in §11.1.2 of ECMA-334:
11.1.2 Default constructors
All value types implicitly declare a public parameterless instance constructor called the default constructor.
The default constructor returns a zero-initialized instance known as the default value for the value type:
Followed by a table of types and their default values.
What kind of problems do you expect?
edit: pre with lang="none" appears to be broken..?
modified on Saturday, September 18, 2010 12:46 PM
|
|
|
|
|
harold aptroot wrote: lang="none"
Try lang="text"
|
|
|
|
|
Thanks, that did the trick. "none" used to work though, I always used that.
|
|
|
|
|
harold aptroot wrote:
What kind of problems do you expect?
I do not know if i will have a problem. I don't remeber where i read, maybe a dsicusion Class versus Struct. that if you change struct member value, you actualy intilizing new instane of a struct. Does that happen in WinAPI or shoudn't i be worried about that?
Maybe it is my paranoia.
|
|
|
|
|
Saksida Bojan wrote: that if you change struct member value, you actualy intilizing new instane of a struct
That is not what happens. Something related does happen though - structs are often copied because their semantics require it, and then changing a field in the struct only causes the copy to change. That is also why it sometimes isn't even allowed.
|
|
|
|
|
|
Hello All,
I am using itextsharp(Free Version) for generating pdf in multilingual site.
Itextsharp tool generate pdf in English language as well as in arabic language also but as per my requirement i want "Arabic Transpanrent" in arabic langauge so is there any way to support "Arabic Transpanrent" font using itextsharp? and can i add "Arabic Transparent" font in itextsharp tool?
How i can support "Arabic Transpanrent" in itextsharp? or if you know any other tool which is support pdf generation with English as well as Arabic langauge ("Arabic Transpanent Font") then please let me know.
Thanks in advance.
Anish Patel
|
|
|
|
|
I have two services that are in a single solution. Each is a windows service. One is a WCF service with a named pipe endpoint.
The other is a service which will consume the WCF service. I'm doing this in Visual Studio 2010 using all 4.0 framework components.
My question is how do I discover the service? When I add Service Reference and hit Discover it says I have no services in my solution.
I created the service by creating a Windows Service, creating a refernce to my service DLL's, and running the service via ServiceHost.
Should I have created this project a different way?? (followed what was posted on MSDN for doing this)
|
|
|
|
|
|
To anybody thinking of answering this, this was just posted in the Lounge.
To the OP, don't cross post.
|
|
|
|
|
Anyone looking for some extra help on a programming project?
I guess my full potential isn't being used at my current company so I'm have a bit of free time left over and am willing to lend it out.
Drop me a mail if you need some help on something,new or old and i'll try add my 2c.
|
|
|
|
|
hi,
i'm a new user and want to develop a mobile software in C#...
any can help me?
i'll be thankfull
|
|
|
|
|
Read the bit at the top of the page - "HOW TO GET AN ANSWER TO YOUR QUESTION".
Then try again. But this time, try following some of the instructions.
For example:
"hi" is a useless title. Try describing your problem.
ishaq shinwari wrote: i'm a new user and want to develop a mobile software in C#...
Is a useless description of your problem. Where are you stuck? What have you tried?
And so forth.
Go on, think about what you are trying to achieve. Or you will get no help at all - and likely, some abuse.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
How about using a search engine or checking on msdn.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|