|
Does anybody have sample code for creating transparent textbox?
I got some sample code in this site (AlphaBlendedTextBox) but it has some problems related to memory leaks and invalidating controls.
Thanks
|
|
|
|
|
Your best bet is probably to write your own. The textbox control wraps the C++ textbox, which is the nastiest control of them all, especially for custom painting.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
It is 0448hrs and I have just written the following...
public class LifePanel
{
public LifePanel(string UserID , string CssClass)
:this(UserID , CssClass , false)
{
}
public LifePanel(string UserID, string CssClass, bool forceImage)
:this(UserID, CssClass)
{
}
}
G'nite....
so you answer don't be scared of failure
The only failure is never to try
Things You've Never Done - Passenger -2008
|
|
|
|
|
This should really be in the Coding horrors forum. Go on - you know you want to.
|
|
|
|
|
My Web App want to access a share folder //IP/share/detail. The folder "detail" was shared to everyone.
in Web.Config
identity impersonate="true"
was added.
in machine.config
processModel userName="SYSTEM" password="AutoGenerate"
userName was changed.
In code
File.Exists("//IP/share/detail/"+fileName)
It return false although the file exist in the folder. Do you have any idea why the file cannot be access?
|
|
|
|
|
Are you sure the process is using impersonation and not the built in ASP.NET account? Change your IIS settings to force Windows Authentication and try again, if it works then you know it is an impersonation failure of some sorts.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
My goal is to make a web service that does NOT need to be restarted anytime an enumeration (and therefore, a dll) changes. Enumerations are changed from my code periodically using System.Reflection.Emit to make them match a database where a second application may update those values at some unknown interval. Therefore, I am dynamically updating a referenced dll using System.Reflection.Emit from within my web service, and I would like to reload the dll reference after the update so my application can use the latest version of the enumerations. Is there a way to do such a thing? Any help is greatly appreciated,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Yes, you can reload the page, but that will make IIS restart the appication to recompile, just the nature of the beast.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
I am trying to load a Korean string resource from a DLL.
I use LoadStringW, after setting Thread.CurrentThread.CurrentCulture to Korean, using PInvoke from C#.
The string I'm trying to receive should be comprised of the following 5 characters:
0xc6a9 0xc9c0 0x002f 0xd488 0xc9c8
however what I get is:
0x00a9 0x00c6 0x00c0 0x00c9 0x002f
Note the relationship between what I expected and what I received.
Anyone have ideas on what I'm doing wrong?
(I hope this is the most appropriate forum, I checked and did not find one API or Internationalization specific)
Thanks,
Don
donrau@hotmail.com
|
|
|
|
|
What does your PInvoke signiture look like? I would declare that method as follows:
[DllImport("user32.dll", CharSet = CharSet.Unicode, EntryPoint = "LoadStringW", SetLastError = true]
public static extern int LoadString(IntPtr hInstance, uint uID, StringBuilder lpBuffer, int nBufferMax); Does this match your declaration? Hope this helps,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Thank you so much! It works now. You've made my week!
I've burnt many hours on this. I did not have the CharSet attribute. None of my research mentioned it and PInvoke.Com did not include it in any of the declarations found there. I'm not sure why the compiler needs the clarification of this attribute to do the correct thing, or what it was doing in it's absence.
Thanks again, your a life saver.
Don Rau
|
|
|
|
|
I have a C# windows services installer that creates a service based on command line input, e.g.:
Enter the numeric ID from the available inspection types to install or 'q' to quit:
1: Structural Areas
2: Electrical Inspection Areas
3. Roof Inspection Areas
4. ...and so on
=> user chooses #3 "Roof Inspection Areas" and the service is created with service name of: RoofInspectionAreas. (hypothetical).
(Assume that my installer was used to create three services altogether: StructuralAreas, ElectricalInspectionAreas, and RoofInspectionAreas. Also assume that none of these services have been started.)
Now when RoofInspectionAreas service is selected to be started from the Windows Services Management Tool, the OnStart() method will perform a lookup in the custom config area of the app.config file to initialize some vars based the current service, e.g.:
<RoofInspectionAreas>
<add key="SweepFolderTime" value="600000"/>
<add key="Recurrence" value="5"/>
...and so on
</RoofInspectionAreas>
My question is: How do I get the current service name, i.e.: RoofInspectionAreas, of the service that is starting (so I can get the right custom config section) without knowing what service was selected to be started? All the examples I have found so far only show how to get a "listing" of services on the current machine.
|
|
|
|
|
Personally, I write the constructors for my Windows Services to take a parameter for its name (and other information). And I do very little in the OnStart handler.
|
|
|
|
|
Hi.
can anyone help me with a small application (I'm thniking a C# console application) that has to:
- Read a .txt file, where a lot (4-500) host names a listed
- ping all the hosts and return the result with:
Hostname, IP_Address, OS Version/Type and Date (The date is the time where the host was "pinged".
This information must be inserted into a database, and the datetime must be overwritten unless if the host does not answer - then the host and the date where it did not answer must be inserted into another table.
I havent done any programmeing with networking so if any one could help me out I'll be very happy.
Also, if there is any questions you just let me know.
Thanks in advance.
\Jan.
|
|
|
|
|
That's not a big deal, I do a couple of things that are similar, one in a Windows Services.
Reading a text file is easy enough, but I prefer XML, or (prefereably) read from the database.
To ping you can use:
System.Net.NetworkInformation.PingReply result = (new System.Net.NetworkInformation.Ping()).Send ( HostName , 1000 )
Then write to the database.
|
|
|
|
|
OK, I'll try that.
Thanks for your answer, but is it possible that you have an example that I can see?
\Jan.
|
|
|
|
|
There is not MeasureItem event for Listview so how can i draw a blank row or keep a distance between each item on DrawItem. Thanks
|
|
|
|
|
From what I can see on google, the only way to change the height of a listviewitem is to create a bitmap that's the right height and make it show in the listviewitem in question.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Is there any simple example
|
|
|
|
|
I got the answer now if you change the listview font size then it adds spaces between rows but this is so stupid of microsoft why would anybody wants to do this way. It also means that all rows would have the same distance.
There isn't anywhere on the .net framwork tells that on DrawItem you cant change the rows size. This is absolutely a nightmare who beginners. any suggestions guys.
|
|
|
|
|
If you were to google this, you'd find that others have had the same problems. At hte core, winforms is just a wrapper on controls that have been there forever, until you move to WPF, you are tied to something that is pretty old now.
Also, the imagelist solution ( which I think is far more robust that changing the font size ) is widely documented on the web.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Plssssssss read the first message in the forum titled "How to get an answer to your question". Pay attention to item #2
led mike
|
|
|
|
|
|
At least he didn't SHOUT PLEEEEEEEEEAAAAAAAASSSSSSEEEEE
codito ergo sum
|
|
|
|