|
Thanks a lot
C++ where friends have access to your private members !
|
|
|
|
|
What you need to do is create a custom designer for your control. Since a bit of code is worth a thousand words, I will stop talking and just post a drop dead simple example.
<pre>using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms.Design;
using System.Drawing;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.ComponentModel;
namespace WindowsApplication1
{
[Designer(typeof(SomeControlDesigner))]
public class SomeControl : Control
{
public SomeControl()
{
this.Size = new Size(100, 25);
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
using (LinearGradientBrush brsh = new LinearGradientBrush(this.ClientRectangle,
Color.CornflowerBlue, Color.White, LinearGradientMode.Vertical))
{
e.Graphics.FillRectangle(brsh, e.ClipRectangle);
}
}
}
public class SomeControlDesigner : ControlDesigner
{
protected override void OnPaintAdornments(System.Windows.Forms.PaintEventArgs pe)
{
base.OnPaintAdornments(pe);
using(SolidBrush brsh = new SolidBrush(Color.Red))
{
pe.Graphics.DrawString(this.Control.Location.ToString(), this.Control.Font,
brsh, pe.ClipRectangle.Location);
}
}
}
}</pre> <br />
<br />
The OnPaint override is there just to make the point that this is a custom control. You'll also need to add a reference to System.Design.dll.
|
|
|
|
|
Excellent .... i am c++ coder and i am just loving C#
C++ where friends have access to your private members !
|
|
|
|
|
Very nice idea!
Got my "5"
All the best,
MArtin
|
|
|
|
|
what is Blob column and how to add in table
|
|
|
|
|
BLOB means Binary Large Object.
These columns store unprocessed binary data, typically files, that can be retrieved and manipulated like the other common datatypes. One sample use would be the storage of images into the database to be retrieved for a website to display.
Regards,
Satips.
|
|
|
|
|
This may not be a C# question but you can use SQL in C# so...
If you were to add a BLOB column to an existing table in SQL you would use:
ALTER TABLE {0} ADD COLUMN Image oleobject
After that, to add an image to that table you have to use a DataAdapter and store the image as a byte[] object to the Image field.
Brent
|
|
|
|
|
Hi,
I want to have a property grid to control properties of a class made by me.
I have searched the forum looking for some articles about it and the only thing i found that seemed to have interest was an article on how to show only some properties.
Assuming that i want to show all.
Isnt there a way of doing this directly?
For examle:
<br />
<br />
MyClass c = new MyClass();<br />
<br />
PropertyGrid.SelectedObject = c;<br />
This didnt work. What do i need more in order to see my attributes show in the property grid?
Thx,
Nuno
|
|
|
|
|
Yes you can show all you got to do is declare the attributes and description on the top of function which ever you want to expose and then you would be able to deal with it through your property grid
|
|
|
|
|
Humm, that was very vague.
Can you point me to a place where that is explain in detail?
At least, a simple example?
Thx
Nuno
|
|
|
|
|
<<<.csharpcorner.com/UploadFile/mgold/PropertyGridInCSharp11302005004139AM/PropertyGridInCSharp.aspx>>>>>>
|
|
|
|
|
Hi,
Thx for the reply but in the mean while i found a cool class here in codeproject which help me manipulating the property grid.
Thx,
Nuno
|
|
|
|
|
Hi Nuno,
I have compiled a list of PropertyGrid resources (see signature) and you will find a lot of informations along all these articles to work with the MS Grid.
|
|
|
|
|
Hello,
Does anybody know if there is ANY way to either get a reference to or just remove event handlers that you didn't declare yourself? (I am writing a plugin, but want to change the functionality of some buttons etc.) I've gathered that this is at least difficult if not impossible from other posts, but if anyone has a horrendous hack I'd like to hear it.
Alternatively, I wondered if it would be possible to identify an event handler through Reflection in order to remove it. Does anybody have any thoughts on this?
Thanks very much,
Keiron
|
|
|
|
|
Hi,
I have got this string "Test\Test1\Test2" and i want to extract Test2 string, how can i do that.
I am using C#.
Warm Regards,
Mushq
|
|
|
|
|
Hello,
You could work with the LastIndexOf(@"\") of the string class.
And then use the Remove(0, lastindex) method of the same class.
All the best,
Martin
|
|
|
|
|
If you need a powerful tool, C# has the Regex class [] [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
How save image to Microsoft Access Database in C#
|
|
|
|
|
first you have to add a Blob column to your table.
Then you read the picture into a Byte[] which
you can insert into your Blob column. There's
also an example in the sdk help which covers
that content.
Open the SDK Help choose the index tab insert BLOBs.
Regards,
Satips.
|
|
|
|
|
|
Hi this code in c#...,How to write in vb.net...,
string strinput;
char[] chararrinput=strinput.ToCharArray();
Byte[] arrbyteinput=new byte[chararrinput.Length-1];
specially,this line "Byte[] arrbyteinput=new byte[chararrinput.Length-1];"
becoz here they are converting that character in to byte....
how to write in vb.net
if any one knows plz help me....,
Magi
|
|
|
|
|
Magh_M wrote: becoz here they are converting that character in to byte
Well, that's not even the correct way to convert characters into bytes in C#. You should be using the relevant encoder.
|
|
|
|
|
No i worked out in c# that code is execute and giving output...,
see this that code:
char[] chararrinput=strinput.ToCharArray();
Byte[] arrbyteinput=new byte[chararrinput.Length-1];
for(i=0;i<chararrinput.length-1;i++)
arrbyteinput[i]="Convert.ToByte(chararrinput[i]);</b">
But i need this in vb.net...,
Magi
|
|
|
|
|
Magh_M wrote: No i worked out in c# that code is execute and giving output
Yes, well done. But it doesn't handle all cases. It will only work if you limit yourself to a basic latin character set.
|
|
|
|
|
ok yar but now i want to convert the character in to byte what i want to do...,
tell that one...............
Magi
|
|
|
|