|
The simple answer is: you can't.
If you really really have to, it might be possible by handling the tooltip yourself.
To do this you'll need to:
(1) Create a tooltip you can maintain reference to.
(2) Implement your own draw via the Draw event, drawing the desired string via the graphics object provided.
(3) Intercept the appropriate mouse events to popup and clear the tooltip.
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
Thank u.
Now,I can get the tooltip by the sentence like this:
ToolTip tip = (ToolTip)ToolStrip1.GetType().InvokeMember("ToolTip", BindingFlags.GetProperty | BindingFlags.NonPublic|BindingFlags.Instance, null, ToolStrip1, null);
I'm able to change the backcolor , forecolor etc.. Except the fontsize.
My purpose is to change the fontsize. how to do it ?
|
|
|
|
|
Add an event handler for the Draw event, then handle the drawing yourself.
The event args will have a Graphics instance you can use to draw the string.
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
|
I want to create a backend application which posts data to a asp.net web server at regular intervals of time..
How to implement this??
Also, if I use a web service, will that me helpful??
Can anyone help me??
Som
|
|
|
|
|
do you understand what is meant,when they say "backend"?
Please tell us in details what do you ant to do and how far have you gone doing it,remember we cannot do work for you, start and get stuck and we will unstuck you.
thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Is it possible to insert a array in the value part of a dictionary?
I want this array of bool:
bool[] arrayOfBool = new bool[10];
I'm not sure how to setup the dictionary, I tried with this:
Dictionary<int, Collection<bool[]>> dict1 = new Dictionary<int, Collection<bool[]>>();
Or this:
Dictionary<int, bool[]> dict2 = new Dictionary<int, bool[]>();
But when I try to add an item for each dictionary, I get some errors. Maybe the entire dictionaries are wrong.
Is this possible? If so, how?
/Steffe!
|
|
|
|
|
What error are you getting? Compile time? Run time? "Errors" isn't very helpful, you know.
Anyway, this works for me:
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
namespace CollectionDictionary
{
class Program
{
static void Main(string[] args)
{
bool[] array1 = new bool[10];
bool[] array2 = new bool[10];
FillBools(array1);
Thread.Sleep(1000);
FillBools(array2);
PrintBools(array1);
PrintBools(array2);
Dictionary<int, bool[]=""> dict = new Dictionary<int, bool[]="">();
dict[1] = array1;
dict[2] = array2;
PrintBools(dict[1]);
PrintBools(dict[2]);
}
private static void FillBools(bool[] array)
{
Random r = new Random((int)DateTime.Now.Ticks);
for (int i = 0; i < array.Length; i++)
{
array[i] = r.Next() % 2 == 0 ? true : false;
}
}
private static void PrintBools(bool[] array)
{
foreach(bool b in array)
{
Console.Write(b + ", ");
}
Console.WriteLine();
}
}
}</int,></int,>
|
|
|
|
|
Your dict2 attempt is the correct way. This is how you add an item to the dictionary:
dict2.Add(42, arrayOfBool);
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks, that worked!
I tried to write the value "true", to one of the bools in the array, with this code:
dict2[42].arrayOfBool[1] = true;
But it didn't work. I got this error:
'System.Array' does not contain a definition for 'arrayOfBool'
How do I get access to one of the bools in the array, so I can give it value?
/Steffe!
|
|
|
|
|
dict[42] will return the array, so you should be able to access the n'th element of the array using
dict[42][n] = true;
|
|
|
|
|
Thanks! That worked fine
|
|
|
|
|
I have a question. I have an image and I want to binarize it in C#. I don't want it to be in a fax (black and white 1 bit) format. It can be in grayscale but it needs to be binirized.
Any ideas on this?
|
|
|
|
|
mikefl wrote: binarize
Pardon? What are you trying to do here? Convert it to a byte stream? If so, you may want to try
public byte[] ConvertImage(Image image)
{
using (MemoryStream ms = new MemoryStream())
{
image.Save(ms, ImageFormat.Gif);
return ms.ToArray();
}
}
|
|
|
|
|
Thanks for the comment. I have a grayscale image. I need to binarize it so that it looks pretty decent. I tried converting it to 1 bit black and white and many of the parts of the image are complete white or black. I need to basically get one grayscale image and convert it into a nice binarized copy of it that's black and white (no gray pixels) but not smudged.
Any ideas?
|
|
|
|
|
I don't understand exactly what you are trying to do. Anyway:
Grayscale means that each pixel will have equal values for R,G and B.
Usually, that value will be (R + G + B) / 3 for the current pixel.
Binarization means that each pixel will either be black or white.
pseudocode:
foreach pixel in image<br />
{<br />
int greyValue = (R + G + B) / 3;<br />
if(greyValue >= threshold)<br />
setPixel(255, 255, 255);
else<br />
setPixel(0, 0, 0);
}
|
|
|
|
|
what would be a good working version of that code? Is there anything online that I can look at that's functional?
|
|
|
|
|
I think Christian Graus has a collection of articles on Image processing here on CP. The grayscale effect is always the first one demonstrated because it's very easy do understand and implement.
|
|
|
|
|
I created a service and its installer.
However the installed service doesn't work.
Why? Windows Firewall block the port my service is listening too.
If, as an administrator, I add my application to the list of app authorized by the firewall that's all good, however I would much prefer if the installer do that for me.
Question: How could I add my app to the authorized application list by the firewall in my installer?
|
|
|
|
|
Hello,
I would like to confirm whether you have started the Service in the services folder.
Running a service and starting a service are two different things. We have to start it after
installing it.
1. To view and start the service, open Control Panel > Administrative Tools.
2. Now click Services, locate the service, right click on it and select 'Start' to start the service.
3. To make it running all the time, change the 'StarttupType' to "Automatic".
I hope this helps.
Regards,
Allen
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
I confirm, it is started.
As a clue to that (for you), I just need to (manually ) add my exe to the authorized list of Windows Firewall for it to work properly!
Now my concern remain, I want to write a proper installer, which will relieve the admin of the burden of having to manually add my service to the authorized list of the windows firewall...
|
|
|
|
|
How to execute other "setup.exe" during installation?
EX:I execute Setup.exe(Setup.msi),when finish its task, not exit;
keep on and execute "aa.exe" and "bb.msi".
When "aa.exe" and "bb.msi" finished, clue to setup finish.
How to make a SetupProgram like this?
Thanks.
|
|
|
|
|
Read the class documentation for the (System.Configuration.Install.)Installer class, that should give you a good start.
|
|
|
|
|
Hello,
I need to send a message hashed by a private key. The first confusion in the whole process is: Do I need to Install certificate on my web server?
Second how should I do it. I saw various links and they say I need to Install the certificate on my system. Please guide me with the examples.Any help is appreciated.
My Private key has extension ".key"
And certificate has extension ".crt"
For example:
http://kbalertz.com/901183/service-using-client-certificate-authentication-application.aspx
Regards,
Pavas
|
|
|
|
|
Hello guys,
I have a small project that I'm trying to accomplish but I can't figure out which way would be easier and more efficient. I'm sure there's a lot of people here that will have more experience than me in this field, so here goes:
I'm basically trying to program an application in C# that will take a bunch of JPEG's and AVI's/MPEG's and then output those files into one big AVI file which shows all those jpeg's and videos in sequence, sort of like a slide show except in a video format. It's kind of close to the Movie Maker application on Windows XP.
I'm not sure how I should implement this. Some have said that I should use VFW, which I know is a sort of an obsolete technology. Some have told me that it's doable in DirectX but I can't find any information on video creation or production in DirectX. DirectShow is also another option but someone had told me that it's impossible to show multiple files on one filter during runtime. Multiple instances would have to be muxed to an output filter, which sounds like a memory-monster idea.
Any help or suggestions would be extremely appreciated
Cheers
|
|
|
|