|
To add an image as an embedded resource:
1)RightClick the project or folder in project in the Solution Explorer
2)Select Add an Existing Item
3)Locate the bitmap (I prefer clicking the arrow on the open button to choose the add as link. By doing this the latest bitmap will always be added in the build)
4)RightClick the bitmap in the project
5)In the properties window change the build action or where it says content and in the combo box make the value Embedded Resource
To use the bitmap in your code:
Bitmap b=new Bitmap(/*stream object*/this.GetType().Assembly.GetManifestResourceStream("{projectname}{.foldername if bitmap is in a folder}.{filename});
or something along those lines.
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 developing a user control which is build with a datagridview, and others controls.
When I use this control in my application at desing time, I'd like to access de properties of the datagridview embebed in my control to add columns. I've created a public property to expose de grid, something like this:
<br />
private System.Windows.Forms.DataGridView _grid;<br />
<br />
[Description("Description"), Category("mycategory"), EditorBrowsable]<br />
public System.Windows.Forms.DataGridView Grid<br />
{<br />
get { return _grid; }<br />
set { _grid = value; }<br />
}<br />
My problem is that I can't access the Columns property at desing time (In the property editor. I get this error:
Object reference not set to an instance of an object.
Then I decide to expose a property for the datagrid columns:
<br />
[Description("My Description"), Category("MyCategory"), EditorBrowsable]<br />
public DataGridViewColumnCollection MyColumns<br />
{<br />
get { return this.grid1.Columns; }<br />
}<br /> Now I've binded the grid to a TableDataAdapter returned by a Web Sevice. My problen now is when I add a new column, the column is not show at execution time. (At desing time I can see the column added). I think that in execution time the grid executes the databinding and rewrites my added column. The same happens if I want to hide one of the columns returned by my Web Service, in execution time the column is visible.
Perhaps doing it programatically I could add and hide columns , but I want to do it the easiest possible for de developers who are going to use this control.
Thanks.
|
|
|
|
|
Just change "private System.Windows.Forms.DataGridView _grid;" to
private System.Windows.Forms.DataGridView _grid=new DataGridView();
|
|
|
|
|
I forgot to post that I've an instance of the grid (In the code behind):
this.grid1 = new Mycontrols.Controles.Grid(this.components);
So that is not the problem.
Thank you.
-- modified at 10:52 Sunday 3rd June, 2007
|
|
|
|
|
I want to make a service which continuously listen the key board and make a entry in log file that have the actions that have been performed through keyboard????????
|
|
|
|
|
Hmm, sounds like a keylogger...
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
|
|
|
|
|
Yeah, you're not going to get any help with something that, 99% of the time, is only used illegally.
|
|
|
|
|
Dave Kreskowiak wrote: you're not going to get any help with something that, 99% of the time, is only used illegally
Probably why he isn't getting any helpful replies
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Yeah! But, this particular app is how I taught myself Remoting, about 6 years ago. When the client started, a window popped up on my machine and I cold see every character the target typed, real-time. Oh, a window for every machine that started up and launched the service. Of course, I made everyone aware of what I was doing!
|
|
|
|
|
Dave Kreskowiak wrote: When the client started, a window popped up on my machine and I cold see every character the target typed, real-time.
I could see it as a possible troubleshooter tool, but I think most people will quickly think of some kind of bad hacker prog
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
That's the first thought I had when I wrote the thing. "Oh how this could be perverted into something bad." I uninstalled the clients and server, zipped up the source and packed it away so noone could grab it.
|
|
|
|
|
Hi every one,
I need to record the phone calls made by the PC into files or a db, i used AT commands, and i'm working on c#.
is it only solved by TAPI??
if so i need a good tutorial in this concern..
Help is highly appreciated and Thanks in advance,
|
|
|
|
|
do you have any code so far?
|
|
|
|
|
|
Hi friends,
While going through Interface topic I came across this doubt..say there is a class called Myclass which implements an interface called ImyInterface..there is a line of code:
ImyInterface xyz=new Myclass()
can u plz explain me what this line of code actually means in terms of object and reference.
Warm Regards,
Rahul
|
|
|
|
|
Normally base class pointer can point to a derived class object.
Here, "new MyClass()" is a derived class Object(since MyClass implements ImyInterface )
and
"xyz" is the base class pointer.
MyClass will implement(define) functions in the Base interface.It can also contain its own new functions.
Even though "xyz" points to an object which contain many functions,through "xyz"
we will be able to call only the functions present in the interface.
Regards,
Arun Kumar.A
|
|
|
|
|
it means nothing or if it means something, there are only two options:
1. it's error
2. the two classes are inherited! but i'm not really sure of this option!
|
|
|
|
|
In CPP I used the macro __FUNCTION__ in order to print calling functions name to my logger. Is there any easy way to do the same in C#?
|
|
|
|
|
Logging method name in .NET[^]
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
HELLO ALL FRINDS HOW R U
I WANT TO MAKE VALIDATION IN FORM
IWANT THE TEXTBOX CONTAIN NUMBERS ONLY AND ONOTHER ONE CONTAIN DATETIME ONLY
HOW CAN I MAKE IT
AND HOW CAN ICOMPAR BETWEEN TWO TEXTBOXS
ASHRAF_23_2005@YAHOO.COM
|
|
|
|
|
Take a look at the documentation and find these items:
- ErrorProvider
- TextBox.Validate event.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
|
|
|
|
|
THANK YOU FOR YOUR MASSEG BUT IWANT YOU TO EXPALIN IT
|
|
|
|
|
STOP YELLING. And, when someone tells you what to use, you should type that into google. An article will always give more info than a forum post.
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 )
|
|
|
|
|
Caps is not going to help you getting help. Especially from me.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
|
|
|
|
|
I am making a program that can take a string and give you all possible strings that can be made out of the characters it contains.
Example:
Bug
Yeilds:
bug
bgu
ugb
ubg
gbu
gub
Can anyone think of how to do this short of trying until I get 6! unique results?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|