|
I need some guidance with the following:
I am trying to write a button control which will have certain properties to set styles such as aqua type.
I looked into aqua button samples here in CP and the one I liked the most is "The Aqualizer"[^] which creates a bitmap image of aqua buttons.
The problem is that it takes a long time to create the image, so what I would like to do is create the image at design time and store the image in the ResourceManager, then at runtime I should be able to load the image for the current button state.
Where I need most guidance is storing the bitmap image into a resx file. By default, VS creates a resx file for my class derived from ButtonBase but I don't know how to access it at design time.
The only way I could think was to read the resx file, then modify it as needed by adding the elements myself with the data for the bitmap files. However, I don't like this method because I depend on the location of the resx file.
Since this is the first time I try using resource managers, I am kind of lost. I did read about it and getting the image seems straight forward, but storing it at design time is another story.
Thanks in advance for any help you can give me.
|
|
|
|
|
You're on the wrong track. What you can do is add the bitmap to your application as a resource, then you can load it from there and apply it to your bitmap in code. The resx file does not *exist* at runtime, it's just part of the files the compiler uses to know what to shove into your exe.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Humm, I guess I could save the image in a memory stream, then add the image to an ImageList and return the index of the image added so the button can redraw itself.
I guess the solution above will work although I am still puzzled if we can make changes to the resx file just like Visual Studio does it at design time.
Thanks,
Rudy.
|
|
|
|
|
rudy.net wrote: Humm, I guess I could save the image in a memory stream, then add the image to an ImageList and return the index of the image added so the button can redraw itself.
You can store it as a Bitmap in your exe, and pull it out as a Bitmap.
rudy.net wrote: I am still puzzled if we can make changes to the resx file just like Visual Studio does it at design time.
What part of 'no' did you not understand ? The resx files do not exist on your client machine, therefore they are not used, therefore you cannot change them.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
My mistake, the subject should say "How do I update *.resx files at design time.
|
|
|
|
|
hi all,
I created a C# Method in a Web Application
public void Getdata(int a){
//code here
}
Now I need to use above function to a SQL Server Function and a Stored Procedure.
How do I call C# Method to SQL Server Function.?
please help me.
thanks in advance
|
|
|
|
|
You can't, unless you have the latest version of SQL Server ( which I don't think is out yet, but there are betas about ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
yo, my current project uses several DLLs. one is quartz.dll found in the system32 folder in the windows directory. my problem is that vc# makes a copy of it (and names it Interop.QuartzTypeLib.dll) to the application directory. is there a way i can change the name (or look for a different name) or have my program search for the file in the system32 folder instead?
|
|
|
|
|
Interop.QuartzTypeLib.dll is not a copy of the .DLL your using. It is a RTC (Runtime Callable Wrapper), that provides the interfacing between your managed code and the unmanaged code in that .DLL. Your code can't live without it and still work with the Quartz.dll. Normally, this file (the Interop .DLL), would be distributed with your .EXE and reside in the same directory as your .EXE when your app is installed.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
looking for an example on your site on how to embed images in a Rich- text box
|
|
|
|
|
|
well, the thing is, i want to do something like what the new yahoo messenger does when u sending or receiving files. I.E, it displays it in the same text window
|
|
|
|
|
See here[^], although I am sure you can find more examples here in CP.
|
|
|
|
|
Hi friends,
Its a while I am looking for a way to keep some object in ASP.NET server memory permanently without loosing it at Application_End event,
Is there any way?
- Mohammad
---
"Art happens when you least expect it."
|
|
|
|
|
Write it to a persistent store in application_end, read it in application_start.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Its an interesting idea, but note that in my situation it is not a value type or a composite of value types, its an object that is doing something in its lifetime, and I want to keep it alive.
---
"Art happens when you least expect it."
|
|
|
|
|
In that case, write it as a windows service ( the process that does this work )
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks for your note;
So it seems there is no way to do it without windows services? yes?
By the way it is not possible to create a windows service in a web application on the fly, isn't it ?
---
"Art happens when you least expect it."
|
|
|
|
|
Den2Fly wrote: So it seems there is no way to do it without windows services? yes?
I doubt it. App end means what it says, your app is stopping.
Den2Fly wrote: By the way it is not possible to create a windows service in a web application on the fly, isn't it ?
Do you mean start one running, or create one ? You can control one. You could just run any old process, the point of a service is that you can control it from your app.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
We have all seen it, you try to delete/move a file/folder and Windows presents you with a message stating that the item cannot be moved/deleted as it is in use by another program.
Is there a way to identify which processes have a "hold" on a file/folder within c#?
I assume that this will be through some API call, but at the moment I am at a loss to find any specific details
post.mode = postmodes.signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
I have written a C++/CLI wrapper around some old C++ code so I can call it from C#, and a VERY simple demo app that calls the code. It works great. I've sent the release builds to the person I write this stuff for, and he gets an error when the code tries to call the C++ DLL :
Could not load file or assembly 'HDRLib, version xxxx culture neutral publickeytoken=null. This application has failed to start because the application configuration is incorrect.
The last bit is a verbatim quote of what HRESULT 0x800736B1 means, being the HRESULT it quotes. Again, this is managed C++ code being called from C#, works fine here.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I havejust begun to program, but only minor things. Mostly i read about sites for help but they just confuse me. Even the beginner C# tutorials here confuse me. This is mostly because of the words and the format. Some expect you to be already familiar with C++, and i am not. If someone could give me some advice of a site to go to, or any information that could possibly help me progress in the ways of C#. Ty for any help
I never think of the future.It comes soon enough
**Albert Einstein**
|
|
|
|
|
You won't find a better site than this one. If you can't work out what we're talking about, buy a book and work through it, and keep asking questions.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Look at some of the free videos at learnvisualstudio.net as often watching a person and listening to what and why they are doing something is a great way to learn
|
|
|
|