|
You don't need a Picturebox. It's too heavy weight to be the base of another control as simple as a TextBox. Besides, the normal TextBox doesn't use one, so why should you?
You can see how MS implemented the TextBox in the .NET BCL by downloading .NET Reflector[^] and using it to open up the System.Windows.Forms namespace. Find the TextBox class and you'll be able to see the complete code for the TextBox with a little work.
You'll see that it inherits from System.Windows.Forms.TextBoxBase. You'll probably want to do the same.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i think he don't want to inherit from TextBox class he want to do it fro scratch
I don't want to inherit from textbox, I want to do it from scratch
|
|
|
|
|
He didn't tell me to inherit from TextBox but from TextBoxBase which is a abstract class
~~~~~~~~~~~~~~
Martin Lundberg
Student, Sweden
|
|
|
|
|
Ahem. Read the post again. I didn't say TextBox , I said TextBoxBase .
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello!
Thanks for the tips about Lutz Roeder's .NET Reflector, might give me some ideas
~~~~~~~~~~~~~~
Martin Lundberg
Student, Sweden
|
|
|
|
|
It's an awsome tool! You can learn a LOT from just poking around the .NET BCL and seeing how MS implemented everything.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Now I am creating excel files by using Odbc driver. But that just creates .xls file with ordinary table in it.
Is it possible to use more excel features? for example to add to some cells green color?
|
|
|
|
|
I wouldn't use odbc to create excel files, if you want to add more features. Just reference to excel's interop class (Microsoft Excel 11.0 Object Library). Then you can create a new excel document add sheets, change cell values, formats and call macros.
Greeting,
Ingo
|
|
|
|
|
Hello,
I'm still messing around the PropertyGrid Control, and I still not sure/don't know about some certain point. And I would like to ask something:
1. The relationship between TypeConverter and PropertyGrid is.When PropertyGrid have to show some data, TypeConverter try to convert object into string form and the PropertyGrid will take that string to show. And when PropertyGrid have to store the object, it will call TypeConverter.ConvertTo() to convert it back into object. Am I right ?
2. Is there anyway to customize the text that is represent the property data shown in PropertyGrid's Cell. for example if I have struct like :-
struct SomeInt<br />
{<br />
public int Current{get;set;};<br />
public int Min{get;}<br />
public int Max{get;}<br />
}
Inside some Class, and the PropertyGrid is assigned to that object.
Inorder to use with TypeConverter, I need to supply all of those 3 fields to ToString() method(needed to create new Instance of SomeInt) and provide some mechanism to parse those 3 fields back to SomeInt. However if it show all 3 field in the PropertyGrid's Cell, user may change the min or max number (which is not desired). So Is there anyway to show just the Current value?
What I means is that, instead of show text like "5-(0,100)" (5 is Current, 0 is min and 100 is max), I want it just display 5.
Do I need to create new class that inherit from PropertyGrid myself?
3. Which article should I read if I want to create new class that inherit from PropertyGrid ?
I'm really sorry that this thread is quite long, My English skill is quite rather bad.
Regards and Thanks
Wutipong W.
|
|
|
|
|
1.
mr_tawan wrote: it will call TypeConverter.ConvertTo() to convert it back into object. Am I right ?
No. Override ConvertTo method to convert object to string for the property grid and Override ConvertFrom method to convert string from property to object.
2.
If you don't want a property to be visible. you can use [Browsable(false)] attribute to decorate the property. But, you might not need it.
3.
You should download Reflector for .Net[^] and look at how Microsoft wrote their typeconverter.
|
|
|
|
|
hello..
i want to make the tab control aligned to the left..the problem is that when i do so via the Alignment property, the Text no longer appear visually on the tab pages!!!
does anyone know how to solve this..
note:this only happens if the Appearance is "normal".if it's "buttons" the problem doesn't occur..
|
|
|
|
|
this is the first time i use interface.
how can i create a class that handle different kinds of objects as dates, numbers, strings...?
|
|
|
|
|
What do you mean??? Implementing the IComparer interface?
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
|
Good, here is an example comparing 2 DateTime instances:
class DateTimeComparer : IComparer
{
public int Comparer(object d1, object d2)
{
if ((d1 is DateTime) && (d2 is DateTime))
{
return DateTime.Compare(d1, d2);
}
else
{
throw new ArgumentException("Object(s) not of type System.DateTime");
}
}
}
This is just an example, your comparison can go differently, especially in comparing objects that implements the IComparable interface.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Hi,all
how can i fill grdiview1 from another webform.
example:
in webform1 i give select command (let's say select * from mytable where id between 20 and 25)
in webform2 gridview should contain data based on query which i gave in webform1.
Regards.
|
|
|
|
|
Hello,
I do not want use default scrollbar of listview. I must activate 'scrollable' property (to manage scrolling event), but how to hide the default scrollbar to use my own scrollbar(2 button control).
Thanks,
Freg.
|
|
|
|
|
|
use a timer and in the timer's tick event just change
the label's location
Regards,
Pramod
|
|
|
|
|
is it possible rotate in rad a control so look it a little inclined?
|
|
|
|
|
The Label control doesn't support this. You'll have to make your own contorl to do this, probably inheriting from Label. You'll need to override the Paint method of the control and supply your own drawing code to rotate the label. You'll probably need to add a property to tell it how much to rotate too.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
No.
.NET doesn't support that.
But if the control is, say, a label, you can create your own control that can be displayed rotated.
I think there is some article on CP about this topic.
___________________________________
Tozzi is right: Gaia is getting rid of us.
My Blog [ITA]
|
|
|
|
|
ciao
potresti indicarmi il tutorial o qualche esempio in rete?
|
|
|
|
|
|
grazie (tnx)
hai msn? E sempre buono avere amici italiani programmatori
do you have msn? It is always good to have italian programmer friend
|
|
|
|