|
I have a class derived from the System.Windows.Forms.TextBox .
I have overridden TextBoxBase.OnModifiedChanged but it never gets called even when I change the text in the text control
Has anyone else experienced the same problem?
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
|
Hi,
I was not able to find the option for PostBuild Action in the C# Project Properties.
(Where I can Specify some Dos commands to run after the project is Compiled)
Is there any alternative feature avaliable?
Thanks,
FiroZ
|
|
|
|
|
FiroZ wrote:
Is there any alternative feature avaliable?
You can add an empty Visual C++ project and then do post builds from that project. Just make sure that the empty C++ project is built last in the solution.
Later,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
MSDN has a BuildRules visual studio addin. It lets you add pre and post build commands to solutions and projects.
can't find the link right now... but i know it's on there somewhere
|
|
|
|
|
|
|
|
Some example code would be nice Cant seem to work it into a form, seems a bit messed up
And why does people write controls without default constructors?
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Card[] crds = new Card[3];
crds[0] = Card.New("My Text", 0);
crds[0].Font = new Font("Times New Roman", 10, FontStyle.Bold);
crds[1] = Card.New("My Text", 1, CardShape.Circle);
crds[1].Shadow = false;
crds[2] = Card.New("Solid Colours", 1);
crds[2].CardUp = Color.SkyBlue;
crds[2].CardOver = Color.SteelBlue;
crds[2].CardDown = Color.Navy;
CardCtrl crd = new CardCtrl(crds);
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
leppie wrote:
And why does people write controls without default constructors?
Because they don't have VS.NET or they use MC++ to test it so they don't realize how important the default constructor is to the forms designer
James
"Java is free - and worth every penny." - Christian Graus
|
|
|
|
|
|
You do use it, but you defer the setting of the various properties until a little bit later.
The "proper" way to create the control is to expose a Cards property which is a Collection of Card objects. The collection can then be modified at runtime and the control will update itself automatically.
An example of this set up is the ListView control; it exposes an Items collection which contains ListViewItems that represent the items in the control. This collection can be modified at runtime, or code can be output by the forms designer to add the items during the form's InitializeComponent() method.
At first this does not makes sense, but then there are added benefits to coding this way: The control is more flexible in that Cards can be added and removed at runtime; and it opens itself to be easier to use because it follows the standard set by the base controls.
James
"Java is free - and worth every penny." - Christian Graus
|
|
|
|
|
I see what your saying, but the Cards array in the CardCtrl class needs to be sized correctly. So to add/remove cards at runtime, ive added an Add() and Remove() method.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Is there any way to figure out that specified assembly is loaded or not. What I am trying to do is I want to check if the assembly is already loaded or not. If not then load it if yes then use it from memory. I don't want to load the assembly all the time so just a check.
Thanks
|
|
|
|
|
|
How reliable and sturdy are the above classes?
Are they good enough to write a small server with upto 50 connections that will be passing a 40 character string to client machines over a LAN?
Any useful reading material for these and the base Socket classes? (beyond MSDN)
Michael
Time flies like an arrow. Fruit flies like a banana
|
|
|
|
|
|
How can I write a user defined struct (like the following struct) in binary form to a file?
<br />
[StructLayout(LayoutKind.Sequential)] <br />
public struct BITMAPFILEHEADER <br />
{<br />
public ushort bfType; <br />
public uint bfSize; <br />
public ushort bfReserved1; <br />
public ushort bfReserved2; <br />
public uint bfOffBits; <br />
}<br />
And how can I write the data of a memory block (the only thing I have is the the "IntPtr") in binary form to a file?
IntPtr p --> file
Thanks, Daniel.
|
|
|
|
|
you can use the BinaryFormatter class to serialize an object to a Stream.
This may or may not fit your needs.
|
|
|
|
|
using System.IO;
...
BITMAPFILEHEADER info = new BITMAPFILEHEADER();
info.bla = bla;
...
BinarySerializer bs = new BinarySerializer(typeof(BITMAPFILEHEADER));
Stream mystream = File.Create("SomeFile.ext");
bs.Serialize(mystream, info);
mystream.Close();
one question, what is the purpose of the attribute on your struct?
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Thank you!
I need the attribut, because the struct is used as a parameter of a interop dll function.
Daniel.
|
|
|
|
|
|
Your options are:
1) Use BinaryWriter, and write them one by one
2) Use serialization (though I'm not sure it will give you exactly what you want on-disk
3) Use unsafe code.
To write the memory block, I think you're only option is unsafe. You'd need to do something like:
IntPtr i = // however you get it;
byte[] data = new byte[size of data];
fixed (byte* pByte = data)
{
*((MyStruct*) pByte) = *((MyStruct*) i.ToPointer());
}
If the data you point to isn't a structure, you'd probably want to copy byte by byte. You could also consider using fixed and using P/Invoke to call CopyMemory
|
|
|
|
|
Ok, I am back
I have a simple custom control. I would like to set a black border around it. However, there is no SetBorder or BorderStyle property for a Control object. Is there a way to do it, or do I have to draw a line around the control?
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|