|
hello
i am using toolstripComboBox.i want to access all the System colour paterns Along with there name how can i do this
i achive this on Simple combo on the form but for toolstripcombo it will not work
|
|
|
|
|
For anyone to be able to help you, we need to know what 'it will not work' means.
Some code (not too much, and properly formatted, use PRE tags) with an indication of which part fails, any error messages etc.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
hello
if i am using simple combo box on the form the Draw item event appear and i use code on this event is
private void cmbboxClr_DrawItem(object sender, DrawItemEventArgs e)
{
Graphics g = e.Graphics;
Rectangle rect = e.Bounds;
if (e.Index >= 0)
{
string n = ((ComboBox)sender).Items[e.Index].ToString();
Font f = new Font("Arial", 9, FontStyle.Regular);
Color c = Color.FromName(n);
Brush b = new SolidBrush(c);
g.DrawString(n, f, Brushes.Black, rect.X, rect.Top);
g.FillRectangle(b, rect.X + 110, rect.Y + 5, rect.Width - 10, rect.Height - 10);
}
}
-----------------------------
and at form load event i use code
Type colorType = typeof(System.Drawing.Color);
PropertyInfo[] propInfoList = colorType.GetProperties(BindingFlags.Static | BindingFlags.DeclaredOnly | BindingFlags.Public);
foreach (PropertyInfo c in propInfoList)
{
this.cmbboxClr.Items.Add(c.Name);
}
-------------------------------
and at select index change i use the code
private void cmbboxClr_SelectedIndexChanged(object sender, EventArgs e)
{
string color = this.cmbboxClr.SelectedItem.ToString();
this.panel1.BackColor = Color.FromName(color);
}
this will do but when i use toolstripcombo i'm not getting event Draw Item how can i achive the same thing using toolstripcombo my main problem is to access system colour patern along with name to change font or background colour
|
|
|
|
|
AFAIK the ToolStripComboBox does not have OwnerDraw capability. In fact most of the ToolStrip versions of controls are 'crippled' to some extend.
You might be able to save yourself a little processing and therefore make it a little faster by modifying your load event handler.
You could do something like:
foreach (string colorName in Enum.GetNames(typeof(KnownColor)))
{
this.cmbboxClr.Items.Add(colorName);
}
in fact you can even shorten that to either of:
this.cmbboxClr.Items.AddRange(Enum.GetNames(typeof(KnownColor)));
this.cbbboxClr.DataSource = Enum.GetNames(typeof(KnownColor)));
I have not done any time comparisons for these suggestions, and so cannot say which, if any, is faster than your current code.
As far as the ToolStripComboBox problem is concerned, it has occurred to me that, you might (again I have not tested it) put a standard ComboBox on the ToolStrip . Take a look at this[^] for further details.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
why not paste your codes?
try to get system colour paterns , bind to the toolstripComboBox;
or "toolstripComboBox.items.add()" one by one;
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 22:04pm.
|
|
|
|
|
hello
i give the code on 13th sep 09 but it is for normal combo draw item event on toolstripcombo there is not any draw item event how i achive it on toolstripcombo
|
|
|
|
|
I successfully execut SSIS package from C#.net
But when i tried that using windows service then SSIS package is not
execute.
How i can execute ssis package which is stored as file using windows service.
|
|
|
|
|
Follow this article: [^]
Make sure that the service run at 32 bit runtime if you use JET or ACE OLEDB connections. As they do not work on 64 bit run time.
|
|
|
|
|
I have put windows media player in a form, and was wondering if there is any way to see the bytes as they are being streamed to the viewer, so that I can manipulate them. I guess this would be like a buffering area where I can check the bytes and then play them.
Thanks
|
|
|
|
|
Didn't you ask this the other day ? I believe you can write what is called a 'pin' which gets inserted into the directX player sequence. If you can do this using WMP, I am not sure. But, that would be the only way to access the data as the player shows it, to have a flow of data in synch with the player.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanks again for you response, I did ask this the other day. I have found that typically the problem is that in forums, if you get one reply then people move on and look for ones that have no responses. Sorry though, I'll try to refrain from double posts here. I'll give the pin thing a try, thank you.
Fox
|
|
|
|
|
I have a app which places a watermark (text) on an image and saves this back to a file.
What I would like to do is lighten a rectangle area behind the text so the text is clearer.
Can anyone point me to articles which would show how to lighten an area. I found many which show how to lighten/darken the image (bitmap) but noe for an area.
|
|
|
|
|
My image processing articles show you how to do that, you'd just have to change the code to only iterate over the pixels you want to lighten
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
1) you can lighten text , so the text is clearer.
2) you can make two pictures (one is lighten, the other is darken)
when mouse over the places , just change the pictures.
3) of course, you can draw a picture, by different way.(Pixel Zoom, different background color.....)
modified 27-May-14 5:28am.
|
|
|
|
|
Hello
I've a strange behaviour
If I add a ToolStripCombo in a toolstripmenu; I can bind that combo to a datatable and all is ok
BUT if I add a toolstripcombo in a second level (under a drop down button for example) the combo bided to the same datasource remain empty
What I'm doing wrong in such case ?
Thank for any help
|
|
|
|
|
why do you want to bind the datasource,
consider to use 'for loop' to add datas one by one.
modified 27-May-14 5:28am.
|
|
|
|
|
Hello
I would answer :
Why using a loop as long as databinding should works ?
But if the answer is that DataBinding never works in such case , we can consider that as a "bug" and use a loop as a turn around
|
|
|
|
|
I have the following XML file on Windows Live SkyDrive and I want to know how can I read the contents of it without downloading it from the SkyDrive?
<?xml version="1.0" encoding="utf-8" ?>
<MySystem>
<version>
<Ver>John Smith</Ver>
<SupportEmail>jrahma@hotmail.com</SupportEmail>
<SupportWebSite>www.JassimRahma.com</SupportWebSite>
</version>
</MySystem>
|
|
|
|
|
Your best bet is probably to look around to see if MS offer an SDK for SkyDrive. I've had a quick google around (by no means a thorough one) and can't find anything, but that doesn't mean something doesn't exist.
Slightly off topic, but it's probably not a good idea to post what appears to be a real email address to a public forum, unless of cause you like reading spam
|
|
|
|
|
Ummm... what? You want something on your computer without having it on your computer?
|
|
|
|
|
PIEBALDconsult wrote: You want something on your computer without having it on your computer
It's called 'Claytons' data
Gees, I thought telepathic software was a stretch, at least that model has a brain at one end, this guy wants P2P telepathy
|
|
|
|
|
NOOOOO
I don't want something on my computer!!
I just want to read the data from the XML when it's on the web server without having to download it?
|
|
|
|
|
Hi
I am looking for someone who can advise me and show an example of how to create a named pipe - one in and one out - with data stream.
To elaborate a little, I need to create a named pipe connection which will pass textual data from a desk top PC to an external device, which will be attached via USB cable. I need two named pipes - one to pass data down to the device and the other pipe to pass messages back to the PC from device.
Can anyone provide any help or example code for me, please?
|
|
|
|
|
AndyASPVB wrote: create a named pipe
you mean like this?[^]
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
Hi
I have done in Win32dll (c++) project and i have used it in C#, using Dllimport[]
One function update the data stream in one thread(running program)
Another function receive the same data stream in another thread(another running program)
You can use
CreateFileMappingA - to create and update the data stream
OpenFileMapping - to read the data stream.
these function are available in winsock2.h
|
|
|
|