By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,573 Members | 3,008 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,573 IT Pros & Developers. It's quick & easy.

The control appereance in a Graphics or Bitmap object.

P: n/a
Have I posted the message to wrong newsgroup?

Or

Does the question is so much strage?

Would someone please kindly direct me to a true newsgroup or resource?

Best Regards
Hamed
"Hamed" <ha***@raymehr.comwrote in message
news:u0**************@TK2MSFTNGP04.phx.gbl...
>Is it possible to get a control (e.g. a checkbox) and make a Graphics
object or a Bitmap object of current face of the control?

The control may be hidden under some other forms or its Visible property
may
be set to false. I need to make a Bitmap or Graphics object that holds the
appearance of the control.
Regards
Hamed
"Hamed" <ha***@raymehr.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>Hello
I want to implement Sparse property for a ColumnStyle so I need above
functionality.

Regards



Aug 14 '06 #1
Share this Question
Share on Google+
15 Replies


P: n/a
Hamed,

If you don't get an answer than has repeatly asking why that is no result.
You see that in these newsgroups many people try to help as much as
possible. The reason should therefore be in your own question.

There is a chance that nobody (at least for that message me) don't
understand what you are asking.

Better is than to rephrase your message again in the same thread.

As well do people avoid persons who don't give any reaction on replies,
because often people place a question and don't pay any attention than
anymore to the given answers and the work that has done by that..

This kind of messages you write now is without sence and not liked in
newsgroups, what can give the result that you get not any answer anymore.

I hope this gives some help,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:u5**************@TK2MSFTNGP03.phx.gbl...
Have I posted the message to wrong newsgroup?

Or

Does the question is so much strage?

Would someone please kindly direct me to a true newsgroup or resource?

Best Regards
Hamed
"Hamed" <ha***@raymehr.comwrote in message
news:u0**************@TK2MSFTNGP04.phx.gbl...
>>Is it possible to get a control (e.g. a checkbox) and make a Graphics
object or a Bitmap object of current face of the control?

The control may be hidden under some other forms or its Visible property
may
be set to false. I need to make a Bitmap or Graphics object that holds
the
appearance of the control.
Regards
Hamed
"Hamed" <ha***@raymehr.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>>Hello
I want to implement Sparse property for a ColumnStyle so I need above
functionality.

Regards




Aug 14 '06 #2

P: n/a
If you want a Bitmap of the Control, call the DrawToBitmap method.Create a
Bitmap of the same size as the Control, and call the DrawToBitmap method,
passing the Bitmap, and the Bounds of the Bitmap to it.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Orange you bland I stopped splaying bananas?
"Hamed" <ha***@raymehr.comwrote in message
news:u5**************@TK2MSFTNGP03.phx.gbl...
Have I posted the message to wrong newsgroup?

Or

Does the question is so much strage?

Would someone please kindly direct me to a true newsgroup or resource?

Best Regards
Hamed
"Hamed" <ha***@raymehr.comwrote in message
news:u0**************@TK2MSFTNGP04.phx.gbl...
>>Is it possible to get a control (e.g. a checkbox) and make a Graphics
object or a Bitmap object of current face of the control?

The control may be hidden under some other forms or its Visible property
may
be set to false. I need to make a Bitmap or Graphics object that holds
the
appearance of the control.
Regards
Hamed
"Hamed" <ha***@raymehr.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>>Hello
I want to implement Sparse property for a ColumnStyle so I need above
functionality.

Regards




Aug 14 '06 #3

P: n/a
Cor

I am partially new in using newsgroups. sorry if this bothered you or any
other here. I just wanted to know if I am sending the question to a wrong
place or not. this is the case.

Anyway, I try to describe the problem in both threads further:

I am developing a ColumnStyle that holds a custom control ( a button or a
numeric up down or something else )

I want to make a property that if set to true (I name it Sparse property)
all cells of the grid is painted by the face of that control. Since we
should implement the Paint method, I want to be able to paint the face of my
custom control in the grid.

Now what is the solution for the above problem?

Regards
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uI****************@TK2MSFTNGP04.phx.gbl...
Hamed,

If you don't get an answer than has repeatly asking why that is no result.
You see that in these newsgroups many people try to help as much as
possible. The reason should therefore be in your own question.

There is a chance that nobody (at least for that message me) don't
understand what you are asking.

Better is than to rephrase your message again in the same thread.

As well do people avoid persons who don't give any reaction on replies,
because often people place a question and don't pay any attention than
anymore to the given answers and the work that has done by that..

This kind of messages you write now is without sence and not liked in
newsgroups, what can give the result that you get not any answer anymore.

I hope this gives some help,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:u5**************@TK2MSFTNGP03.phx.gbl...
>Have I posted the message to wrong newsgroup?

Or

Does the question is so much strage?

Would someone please kindly direct me to a true newsgroup or resource?

Best Regards
Hamed
"Hamed" <ha***@raymehr.comwrote in message
news:u0**************@TK2MSFTNGP04.phx.gbl...
>>>Is it possible to get a control (e.g. a checkbox) and make a Graphics
object or a Bitmap object of current face of the control?

The control may be hidden under some other forms or its Visible property
may
be set to false. I need to make a Bitmap or Graphics object that holds
the
appearance of the control.
Regards
Hamed
"Hamed" <ha***@raymehr.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl.. .
Hello
I want to implement Sparse property for a ColumnStyle so I need above
functionality.

Regards




Aug 15 '06 #4

P: n/a
Hamed,

It becomes more clear, only there are AFAIK 5 types of Grid's in dotNet,
which one is the one you want to inherit? Not that I know it, but I know
active people in this newsgroup who have done a lot with this kind of stuff.

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:ue**************@TK2MSFTNGP06.phx.gbl...
Cor

I am partially new in using newsgroups. sorry if this bothered you or any
other here. I just wanted to know if I am sending the question to a wrong
place or not. this is the case.

Anyway, I try to describe the problem in both threads further:

I am developing a ColumnStyle that holds a custom control ( a button or a
numeric up down or something else )

I want to make a property that if set to true (I name it Sparse property)
all cells of the grid is painted by the face of that control. Since we
should implement the Paint method, I want to be able to paint the face of
my custom control in the grid.

Now what is the solution for the above problem?

Regards
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uI****************@TK2MSFTNGP04.phx.gbl...
>Hamed,

If you don't get an answer than has repeatly asking why that is no
result. You see that in these newsgroups many people try to help as much
as possible. The reason should therefore be in your own question.

There is a chance that nobody (at least for that message me) don't
understand what you are asking.

Better is than to rephrase your message again in the same thread.

As well do people avoid persons who don't give any reaction on replies,
because often people place a question and don't pay any attention than
anymore to the given answers and the work that has done by that..

This kind of messages you write now is without sence and not liked in
newsgroups, what can give the result that you get not any answer anymore.

I hope this gives some help,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:u5**************@TK2MSFTNGP03.phx.gbl...
>>Have I posted the message to wrong newsgroup?

Or

Does the question is so much strage?

Would someone please kindly direct me to a true newsgroup or resource?

Best Regards
Hamed
"Hamed" <ha***@raymehr.comwrote in message
news:u0**************@TK2MSFTNGP04.phx.gbl...
Is it possible to get a control (e.g. a checkbox) and make a Graphics
object or a Bitmap object of current face of the control?

The control may be hidden under some other forms or its Visible
property may
be set to false. I need to make a Bitmap or Graphics object that holds
the
appearance of the control.
Regards
Hamed
"Hamed" <ha***@raymehr.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl. ..
Hello
>
>
I want to implement Sparse property for a ColumnStyle so I need above
functionality.
>
Regards
>
>




Aug 15 '06 #5

P: n/a
I want to inherit my ColumnStyle from
System.Windows.Forms.DataGridColumnStyle

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
Hamed,

It becomes more clear, only there are AFAIK 5 types of Grid's in dotNet,
which one is the one you want to inherit? Not that I know it, but I know
active people in this newsgroup who have done a lot with this kind of
stuff.

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:ue**************@TK2MSFTNGP06.phx.gbl...
>Cor

I am partially new in using newsgroups. sorry if this bothered you or any
other here. I just wanted to know if I am sending the question to a wrong
place or not. this is the case.

Anyway, I try to describe the problem in both threads further:

I am developing a ColumnStyle that holds a custom control ( a button or a
numeric up down or something else )

I want to make a property that if set to true (I name it Sparse property)
all cells of the grid is painted by the face of that control. Since we
should implement the Paint method, I want to be able to paint the face of
my custom control in the grid.

Now what is the solution for the above problem?

Regards
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uI****************@TK2MSFTNGP04.phx.gbl...
>>Hamed,

If you don't get an answer than has repeatly asking why that is no
result. You see that in these newsgroups many people try to help as much
as possible. The reason should therefore be in your own question.

There is a chance that nobody (at least for that message me) don't
understand what you are asking.

Better is than to rephrase your message again in the same thread.

As well do people avoid persons who don't give any reaction on replies,
because often people place a question and don't pay any attention than
anymore to the given answers and the work that has done by that..

This kind of messages you write now is without sence and not liked in
newsgroups, what can give the result that you get not any answer
anymore.

I hope this gives some help,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:u5**************@TK2MSFTNGP03.phx.gbl...
Have I posted the message to wrong newsgroup?

Or

Does the question is so much strage?

Would someone please kindly direct me to a true newsgroup or resource?

Best Regards
Hamed
"Hamed" <ha***@raymehr.comwrote in message
news:u0**************@TK2MSFTNGP04.phx.gbl...
>Is it possible to get a control (e.g. a checkbox) and make a Graphics
>object or a Bitmap object of current face of the control?
>
The control may be hidden under some other forms or its Visible
property may
be set to false. I need to make a Bitmap or Graphics object that holds
the
appearance of the control.
>
>
Regards
Hamed
>
>
"Hamed" <ha***@raymehr.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl.. .
>Hello
>>
>>
>I want to implement Sparse property for a ColumnStyle so I need above
>functionality.
>>
>Regards
>>
>>
>
>
>
>




Aug 15 '06 #6

P: n/a
Hamed,

Maybe you can find on this page some stuff that can help you. (It is VB but
that is for most people easily to translate in C# stuff, as far as I could
see is there in the code no part of the VB extensions on the framework
used).

http://www.vb-tips.com/dbpages.aspx?...2-d85153e86736

And you were right, you missed the most propitiate newsgroup for this
question.

Microsoft.public.dotnet.framework.adonet
and the special datagrid newsgroups, but those are mainly inactive.

As I wrote this is not my stuff, Ken is active in the VB newsgroups and
forums, as you ask it there as well, will your question than of course be
answered as well in VB code.

I hope this helps,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:%2******************@TK2MSFTNGP05.phx.gbl...
>I want to inherit my ColumnStyle from
System.Windows.Forms.DataGridColumnStyle

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
>Hamed,

It becomes more clear, only there are AFAIK 5 types of Grid's in dotNet,
which one is the one you want to inherit? Not that I know it, but I know
active people in this newsgroup who have done a lot with this kind of
stuff.

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:ue**************@TK2MSFTNGP06.phx.gbl...
>>Cor

I am partially new in using newsgroups. sorry if this bothered you or
any other here. I just wanted to know if I am sending the question to a
wrong place or not. this is the case.

Anyway, I try to describe the problem in both threads further:

I am developing a ColumnStyle that holds a custom control ( a button or
a numeric up down or something else )

I want to make a property that if set to true (I name it Sparse
property) all cells of the grid is painted by the face of that control.
Since we should implement the Paint method, I want to be able to paint
the face of my custom control in the grid.

Now what is the solution for the above problem?

Regards
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uI****************@TK2MSFTNGP04.phx.gbl.. .
Hamed,

If you don't get an answer than has repeatly asking why that is no
result. You see that in these newsgroups many people try to help as
much as possible. The reason should therefore be in your own question.

There is a chance that nobody (at least for that message me) don't
understand what you are asking.

Better is than to rephrase your message again in the same thread.

As well do people avoid persons who don't give any reaction on replies,
because often people place a question and don't pay any attention than
anymore to the given answers and the work that has done by that..

This kind of messages you write now is without sence and not liked in
newsgroups, what can give the result that you get not any answer
anymore.

I hope this gives some help,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:u5**************@TK2MSFTNGP03.phx.gbl...
Have I posted the message to wrong newsgroup?
>
Or
>
Does the question is so much strage?
>
Would someone please kindly direct me to a true newsgroup or resource?
>
Best Regards
Hamed
>
>
"Hamed" <ha***@raymehr.comwrote in message
news:u0**************@TK2MSFTNGP04.phx.gbl.. .
>>Is it possible to get a control (e.g. a checkbox) and make a
>>Graphics
>>object or a Bitmap object of current face of the control?
>>
>The control may be hidden under some other forms or its Visible
>property may
>be set to false. I need to make a Bitmap or Graphics object that
>holds the
>appearance of the control.
>>
>>
>Regards
>Hamed
>>
>>
>"Hamed" <ha***@raymehr.comwrote in message
>news:%2****************@TK2MSFTNGP02.phx.gbl. ..
>>Hello
>>>
>>>
>>I want to implement Sparse property for a ColumnStyle so I need
>>above
>>functionality.
>>>
>>Regards
>>>
>>>
>>
>>
>>
>>
>
>




Aug 15 '06 #7

P: n/a
Kevin

Thanks for suggestion but this method is new in the .NET Framework version
2.0

Unfortunately I am using .NET Framework version 1.1

Is there a solution for me in .NET Framework version 1.1 ?

Regards

"Kevin Spencer" <uc*@ftc.govwrote in message
news:u2****************@TK2MSFTNGP03.phx.gbl...
If you want a Bitmap of the Control, call the DrawToBitmap method.Create a
Bitmap of the same size as the Control, and call the DrawToBitmap method,
passing the Bitmap, and the Bounds of the Bitmap to it.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Orange you bland I stopped splaying bananas?
"Hamed" <ha***@raymehr.comwrote in message
news:u5**************@TK2MSFTNGP03.phx.gbl...
>Have I posted the message to wrong newsgroup?

Or

Does the question is so much strage?

Would someone please kindly direct me to a true newsgroup or resource?

Best Regards
Hamed
"Hamed" <ha***@raymehr.comwrote in message
news:u0**************@TK2MSFTNGP04.phx.gbl...
>>>Is it possible to get a control (e.g. a checkbox) and make a Graphics
object or a Bitmap object of current face of the control?

The control may be hidden under some other forms or its Visible property
may
be set to false. I need to make a Bitmap or Graphics object that holds
the
appearance of the control.
Regards
Hamed
"Hamed" <ha***@raymehr.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl.. .
Hello
I want to implement Sparse property for a ColumnStyle so I need above
functionality.

Regards




Aug 15 '06 #8

P: n/a
Cor

I need simply a sparse property that I want to make in my inherited
DataGridColumnStyle class

What you mentioned is a DataGrid ColumnStyle that shows images. The code the
I need is to make the bitmap from the control.

Suppose I have a hidden TrackBar that I want to show in the column of the
DataGrid. I want to make a Bitmap object from the TrackBar (that is hidden)
and paint the Bitmap in each cell.
How can I make a Bitmap object from the appereance of the control?
Regards

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hamed,

Maybe you can find on this page some stuff that can help you. (It is VB
but that is for most people easily to translate in C# stuff, as far as I
could see is there in the code no part of the VB extensions on the
framework used).

http://www.vb-tips.com/dbpages.aspx?...2-d85153e86736

And you were right, you missed the most propitiate newsgroup for this
question.

Microsoft.public.dotnet.framework.adonet
and the special datagrid newsgroups, but those are mainly inactive.

As I wrote this is not my stuff, Ken is active in the VB newsgroups and
forums, as you ask it there as well, will your question than of course be
answered as well in VB code.

I hope this helps,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:%2******************@TK2MSFTNGP05.phx.gbl...
>>I want to inherit my ColumnStyle from
System.Windows.Forms.DataGridColumnStyle

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl. ..
>>Hamed,

It becomes more clear, only there are AFAIK 5 types of Grid's in dotNet,
which one is the one you want to inherit? Not that I know it, but I know
active people in this newsgroup who have done a lot with this kind of
stuff.

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:ue**************@TK2MSFTNGP06.phx.gbl...
Cor

I am partially new in using newsgroups. sorry if this bothered you or
any other here. I just wanted to know if I am sending the question to a
wrong place or not. this is the case.

Anyway, I try to describe the problem in both threads further:

I am developing a ColumnStyle that holds a custom control ( a button or
a numeric up down or something else )

I want to make a property that if set to true (I name it Sparse
property) all cells of the grid is painted by the face of that control.
Since we should implement the Paint method, I want to be able to paint
the face of my custom control in the grid.

Now what is the solution for the above problem?

Regards
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uI****************@TK2MSFTNGP04.phx.gbl. ..
Hamed,
>
If you don't get an answer than has repeatly asking why that is no
result. You see that in these newsgroups many people try to help as
much as possible. The reason should therefore be in your own question.
>
There is a chance that nobody (at least for that message me) don't
understand what you are asking.
>
Better is than to rephrase your message again in the same thread.
>
As well do people avoid persons who don't give any reaction on
replies, because often people place a question and don't pay any
attention than anymore to the given answers and the work that has done
by that..
>
This kind of messages you write now is without sence and not liked in
newsgroups, what can give the result that you get not any answer
anymore.
>
I hope this gives some help,
>
Cor
>
>
>
"Hamed" <ha***@raymehr.comschreef in bericht
news:u5**************@TK2MSFTNGP03.phx.gbl.. .
>Have I posted the message to wrong newsgroup?
>>
>Or
>>
>Does the question is so much strage?
>>
>Would someone please kindly direct me to a true newsgroup or
>resource?
>>
>Best Regards
>Hamed
>>
>>
>"Hamed" <ha***@raymehr.comwrote in message
>news:u0**************@TK2MSFTNGP04.phx.gbl. ..
>>>Is it possible to get a control (e.g. a checkbox) and make a
>>>Graphics
>>>object or a Bitmap object of current face of the control?
>>>
>>The control may be hidden under some other forms or its Visible
>>property may
>>be set to false. I need to make a Bitmap or Graphics object that
>>holds the
>>appearance of the control.
>>>
>>>
>>Regards
>>Hamed
>>>
>>>
>>"Hamed" <ha***@raymehr.comwrote in message
>>news:%2****************@TK2MSFTNGP02.phx.gbl ...
>>>Hello
>>>>
>>>>
>>>I want to implement Sparse property for a ColumnStyle so I need
>>>above
>>>functionality.
>>>>
>>>Regards
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>>
>
>




Aug 15 '06 #9

P: n/a
Hamed,

As I said it is not my code, but a quick look in it shows me this. (I have
made two conversions to C# to show how easy it is to read VB as C# the rest
is almost adding some (), {} and the ; and removing the end clauses.

Dim bm As Bitmap
In C# this is
Bitmap bm;

If TypeOf objData Is String Then
Dim fs As New FileStream(objData.ToString,
FileMode.Open)
in C# this is
FileStream fs = new FileStream(objDataToString, FileMode.Open);

bm = CType(Bitmap.FromStream(fs), Bitmap)
fs.Close()
Else
Try
bm = ConvertToBitmap(DirectCast(objData, Byte()),
78)
Catch
bm = ConvertToBitmap(DirectCast(objData, Byte()), 0)
End Try
End If
Dim h As Integer
Dim s As Double

Here is an image converted to a bitmap, so in my idea should using a bitmap
direct not change this code very much. However as I said in other words
already, bitmaps are not my favorite sport.

Cor

"Cor Ligthert [MVP]" <no************@planet.nlschreef in bericht
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hamed,

Maybe you can find on this page some stuff that can help you. (It is VB
but that is for most people easily to translate in C# stuff, as far as I
could see is there in the code no part of the VB extensions on the
framework used).

http://www.vb-tips.com/dbpages.aspx?...2-d85153e86736

And you were right, you missed the most propitiate newsgroup for this
question.

Microsoft.public.dotnet.framework.adonet
and the special datagrid newsgroups, but those are mainly inactive.

As I wrote this is not my stuff, Ken is active in the VB newsgroups and
forums, as you ask it there as well, will your question than of course be
answered as well in VB code.

I hope this helps,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:%2******************@TK2MSFTNGP05.phx.gbl...
>>I want to inherit my ColumnStyle from
System.Windows.Forms.DataGridColumnStyle

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl. ..
>>Hamed,

It becomes more clear, only there are AFAIK 5 types of Grid's in dotNet,
which one is the one you want to inherit? Not that I know it, but I know
active people in this newsgroup who have done a lot with this kind of
stuff.

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:ue**************@TK2MSFTNGP06.phx.gbl...
Cor

I am partially new in using newsgroups. sorry if this bothered you or
any other here. I just wanted to know if I am sending the question to a
wrong place or not. this is the case.

Anyway, I try to describe the problem in both threads further:

I am developing a ColumnStyle that holds a custom control ( a button or
a numeric up down or something else )

I want to make a property that if set to true (I name it Sparse
property) all cells of the grid is painted by the face of that control.
Since we should implement the Paint method, I want to be able to paint
the face of my custom control in the grid.

Now what is the solution for the above problem?

Regards
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uI****************@TK2MSFTNGP04.phx.gbl. ..
Hamed,
>
If you don't get an answer than has repeatly asking why that is no
result. You see that in these newsgroups many people try to help as
much as possible. The reason should therefore be in your own question.
>
There is a chance that nobody (at least for that message me) don't
understand what you are asking.
>
Better is than to rephrase your message again in the same thread.
>
As well do people avoid persons who don't give any reaction on
replies, because often people place a question and don't pay any
attention than anymore to the given answers and the work that has done
by that..
>
This kind of messages you write now is without sence and not liked in
newsgroups, what can give the result that you get not any answer
anymore.
>
I hope this gives some help,
>
Cor
>
>
>
"Hamed" <ha***@raymehr.comschreef in bericht
news:u5**************@TK2MSFTNGP03.phx.gbl.. .
>Have I posted the message to wrong newsgroup?
>>
>Or
>>
>Does the question is so much strage?
>>
>Would someone please kindly direct me to a true newsgroup or
>resource?
>>
>Best Regards
>Hamed
>>
>>
>"Hamed" <ha***@raymehr.comwrote in message
>news:u0**************@TK2MSFTNGP04.phx.gbl. ..
>>>Is it possible to get a control (e.g. a checkbox) and make a
>>>Graphics
>>>object or a Bitmap object of current face of the control?
>>>
>>The control may be hidden under some other forms or its Visible
>>property may
>>be set to false. I need to make a Bitmap or Graphics object that
>>holds the
>>appearance of the control.
>>>
>>>
>>Regards
>>Hamed
>>>
>>>
>>"Hamed" <ha***@raymehr.comwrote in message
>>news:%2****************@TK2MSFTNGP02.phx.gbl ...
>>>Hello
>>>>
>>>>
>>>I want to implement Sparse property for a ColumnStyle so I need
>>>above
>>>functionality.
>>>>
>>>Regards
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>>
>
>




Aug 15 '06 #10

P: n/a
I know VB as well as C#. But the VB code does not show how to make a Bitmap
object from current face of a Control such as a TrackBar, CheckBox, etc.
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:OP**************@TK2MSFTNGP05.phx.gbl...
Hamed,

As I said it is not my code, but a quick look in it shows me this. (I have
made two conversions to C# to show how easy it is to read VB as C# the
rest is almost adding some (), {} and the ; and removing the end clauses.

Dim bm As Bitmap
In C# this is
Bitmap bm;

If TypeOf objData Is String Then
Dim fs As New FileStream(objData.ToString,
FileMode.Open)
in C# this is
FileStream fs = new FileStream(objDataToString, FileMode.Open);

bm = CType(Bitmap.FromStream(fs), Bitmap)
fs.Close()
Else
Try
bm = ConvertToBitmap(DirectCast(objData, Byte()),
78)
Catch
bm = ConvertToBitmap(DirectCast(objData, Byte()),
0)
End Try
End If
Dim h As Integer
Dim s As Double

Here is an image converted to a bitmap, so in my idea should using a
bitmap direct not change this code very much. However as I said in other
words already, bitmaps are not my favorite sport.

Cor

"Cor Ligthert [MVP]" <no************@planet.nlschreef in bericht
news:%2****************@TK2MSFTNGP06.phx.gbl...
>Hamed,

Maybe you can find on this page some stuff that can help you. (It is VB
but that is for most people easily to translate in C# stuff, as far as I
could see is there in the code no part of the VB extensions on the
framework used).

http://www.vb-tips.com/dbpages.aspx?...2-d85153e86736

And you were right, you missed the most propitiate newsgroup for this
question.

Microsoft.public.dotnet.framework.adonet
and the special datagrid newsgroups, but those are mainly inactive.

As I wrote this is not my stuff, Ken is active in the VB newsgroups and
forums, as you ask it there as well, will your question than of course be
answered as well in VB code.

I hope this helps,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:%2******************@TK2MSFTNGP05.phx.gbl. ..
>>>I want to inherit my ColumnStyle from
System.Windows.Forms.DataGridColumnStyle

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl.. .
Hamed,

It becomes more clear, only there are AFAIK 5 types of Grid's in
dotNet, which one is the one you want to inherit? Not that I know it,
but I know active people in this newsgroup who have done a lot with
this kind of stuff.

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:ue**************@TK2MSFTNGP06.phx.gbl...
Cor
>
I am partially new in using newsgroups. sorry if this bothered you or
any other here. I just wanted to know if I am sending the question to
a wrong place or not. this is the case.
>
Anyway, I try to describe the problem in both threads further:
>
I am developing a ColumnStyle that holds a custom control ( a button
or a numeric up down or something else )
>
I want to make a property that if set to true (I name it Sparse
property) all cells of the grid is painted by the face of that
control. Since we should implement the Paint method, I want to be able
to paint the face of my custom control in the grid.
>
Now what is the solution for the above problem?
>
Regards
>
>
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uI****************@TK2MSFTNGP04.phx.gbl.. .
>Hamed,
>>
>If you don't get an answer than has repeatly asking why that is no
>result. You see that in these newsgroups many people try to help as
>much as possible. The reason should therefore be in your own
>question.
>>
>There is a chance that nobody (at least for that message me) don't
>understand what you are asking.
>>
>Better is than to rephrase your message again in the same thread.
>>
>As well do people avoid persons who don't give any reaction on
>replies, because often people place a question and don't pay any
>attention than anymore to the given answers and the work that has
>done by that..
>>
>This kind of messages you write now is without sence and not liked in
>newsgroups, what can give the result that you get not any answer
>anymore.
>>
>I hope this gives some help,
>>
>Cor
>>
>>
>>
>"Hamed" <ha***@raymehr.comschreef in bericht
>news:u5**************@TK2MSFTNGP03.phx.gbl. ..
>>Have I posted the message to wrong newsgroup?
>>>
>>Or
>>>
>>Does the question is so much strage?
>>>
>>Would someone please kindly direct me to a true newsgroup or
>>resource?
>>>
>>Best Regards
>>Hamed
>>>
>>>
>>"Hamed" <ha***@raymehr.comwrote in message
>>news:u0**************@TK2MSFTNGP04.phx.gbl.. .
>>>>Is it possible to get a control (e.g. a checkbox) and make a
>>>>Graphics
>>>>object or a Bitmap object of current face of the control?
>>>>
>>>The control may be hidden under some other forms or its Visible
>>>property may
>>>be set to false. I need to make a Bitmap or Graphics object that
>>>holds the
>>>appearance of the control.
>>>>
>>>>
>>>Regards
>>>Hamed
>>>>
>>>>
>>>"Hamed" <ha***@raymehr.comwrote in message
>>>news:%2****************@TK2MSFTNGP02.phx.gb l...
>>>>Hello
>>>>>
>>>>>
>>>>I want to implement Sparse property for a ColumnStyle so I need
>>>>above
>>>>functionality.
>>>>>
>>>>Regards
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>




Aug 15 '06 #11

P: n/a
Hamed,

It seems that at least I have the idea where you are after.

Some of what you probably want to use is deep in Win32.
What you call the face is something I call the shape.

Although you can do a lot but doing that very deep is in my idea absolute
not a question for a newsgroup.

This is a simple sample to change the shape of a form.

http://www.vb-tips.com/dbpages.aspx?...8-a2eda88e06ee
Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:uk**************@TK2MSFTNGP05.phx.gbl...
>I know VB as well as C#. But the VB code does not show how to make a Bitmap
object from current face of a Control such as a TrackBar, CheckBox, etc.
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:OP**************@TK2MSFTNGP05.phx.gbl...
>Hamed,

As I said it is not my code, but a quick look in it shows me this. (I
have made two conversions to C# to show how easy it is to read VB as C#
the rest is almost adding some (), {} and the ; and removing the end
clauses.

Dim bm As Bitmap
In C# this is
Bitmap bm;

If TypeOf objData Is String Then
Dim fs As New FileStream(objData.ToString,
FileMode.Open)
in C# this is
FileStream fs = new FileStream(objDataToString, FileMode.Open);

bm = CType(Bitmap.FromStream(fs), Bitmap)
fs.Close()
Else
Try
bm = ConvertToBitmap(DirectCast(objData, Byte()),
78)
Catch
bm = ConvertToBitmap(DirectCast(objData, Byte()),
0)
End Try
End If
Dim h As Integer
Dim s As Double

Here is an image converted to a bitmap, so in my idea should using a
bitmap direct not change this code very much. However as I said in other
words already, bitmaps are not my favorite sport.

Cor

"Cor Ligthert [MVP]" <no************@planet.nlschreef in bericht
news:%2****************@TK2MSFTNGP06.phx.gbl...
>>Hamed,

Maybe you can find on this page some stuff that can help you. (It is VB
but that is for most people easily to translate in C# stuff, as far as I
could see is there in the code no part of the VB extensions on the
framework used).

http://www.vb-tips.com/dbpages.aspx?...2-d85153e86736

And you were right, you missed the most propitiate newsgroup for this
question.

Microsoft.public.dotnet.framework.adonet
and the special datagrid newsgroups, but those are mainly inactive.

As I wrote this is not my stuff, Ken is active in the VB newsgroups and
forums, as you ask it there as well, will your question than of course
be answered as well in VB code.

I hope this helps,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:%2******************@TK2MSFTNGP05.phx.gbl.. .
I want to inherit my ColumnStyle from
System.Windows.Forms.DataGridColumnStyle

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl. ..
Hamed,
>
It becomes more clear, only there are AFAIK 5 types of Grid's in
dotNet, which one is the one you want to inherit? Not that I know it,
but I know active people in this newsgroup who have done a lot with
this kind of stuff.
>
Cor
>
"Hamed" <ha***@raymehr.comschreef in bericht
news:ue**************@TK2MSFTNGP06.phx.gbl.. .
>Cor
>>
>I am partially new in using newsgroups. sorry if this bothered you or
>any other here. I just wanted to know if I am sending the question to
>a wrong place or not. this is the case.
>>
>Anyway, I try to describe the problem in both threads further:
>>
>I am developing a ColumnStyle that holds a custom control ( a button
>or a numeric up down or something else )
>>
>I want to make a property that if set to true (I name it Sparse
>property) all cells of the grid is painted by the face of that
>control. Since we should implement the Paint method, I want to be
>able to paint the face of my custom control in the grid.
>>
>Now what is the solution for the above problem?
>>
>Regards
>>
>>
>"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
>news:uI****************@TK2MSFTNGP04.phx.gbl. ..
>>Hamed,
>>>
>>If you don't get an answer than has repeatly asking why that is no
>>result. You see that in these newsgroups many people try to help as
>>much as possible. The reason should therefore be in your own
>>question.
>>>
>>There is a chance that nobody (at least for that message me) don't
>>understand what you are asking.
>>>
>>Better is than to rephrase your message again in the same thread.
>>>
>>As well do people avoid persons who don't give any reaction on
>>replies, because often people place a question and don't pay any
>>attention than anymore to the given answers and the work that has
>>done by that..
>>>
>>This kind of messages you write now is without sence and not liked
>>in newsgroups, what can give the result that you get not any answer
>>anymore.
>>>
>>I hope this gives some help,
>>>
>>Cor
>>>
>>>
>>>
>>"Hamed" <ha***@raymehr.comschreef in bericht
>>news:u5**************@TK2MSFTNGP03.phx.gbl.. .
>>>Have I posted the message to wrong newsgroup?
>>>>
>>>Or
>>>>
>>>Does the question is so much strage?
>>>>
>>>Would someone please kindly direct me to a true newsgroup or
>>>resource?
>>>>
>>>Best Regards
>>>Hamed
>>>>
>>>>
>>>"Hamed" <ha***@raymehr.comwrote in message
>>>news:u0**************@TK2MSFTNGP04.phx.gbl. ..
>>>>>Is it possible to get a control (e.g. a checkbox) and make a
>>>>>Graphics
>>>>>object or a Bitmap object of current face of the control?
>>>>>
>>>>The control may be hidden under some other forms or its Visible
>>>>property may
>>>>be set to false. I need to make a Bitmap or Graphics object that
>>>>holds the
>>>>appearance of the control.
>>>>>
>>>>>
>>>>Regards
>>>>Hamed
>>>>>
>>>>>
>>>>"Hamed" <ha***@raymehr.comwrote in message
>>>>news:%2****************@TK2MSFTNGP02.phx.g bl...
>>>>>Hello
>>>>>>
>>>>>>
>>>>>I want to implement Sparse property for a ColumnStyle so I need
>>>>>above
>>>>>functionality.
>>>>>>
>>>>>Regards
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>




Aug 15 '06 #12

P: n/a
Hamed,

This is what i use to create a bitmap from a control:

Private Function _renderImageFromControl(ByVal control As
System.Windows.Forms.Control) As System.Drawing.Bitmap

' Get this form's Graphics object.
Dim me_gr As System.Drawing.Graphics = control.CreateGraphics()
' Me._axFramerControl.CreateGraphics

' Make a Bitmap to hold the image.
Dim bm As New System.Drawing.Bitmap(control.ClientSize.Width,
control.ClientSize.Height)
Dim bm_gr As System.Drawing.Graphics =
System.Drawing.Graphics.FromImage(bm)
Dim bm_hdc As IntPtr = bm_gr.GetHdc

' Get the form's hDC. We must do this after
' creating the new Bitmap, which uses me_gr.
Dim me_hdc As IntPtr = me_gr.GetHdc

' BitBlt the form's image onto the Bitmap.
BitBlt(bm_hdc, 0, 0, control.ClientSize.Width,
control.ClientSize.Height, me_hdc, 0, 0, SRCCOPY)

me_gr.ReleaseHdc(me_hdc)
bm_gr.ReleaseHdc(bm_hdc)

' Return the result.
Return bm

End Function

Hope this helps.

Cheers,
Rob

Hamed wrote:
Cor

I need simply a sparse property that I want to make in my inherited
DataGridColumnStyle class

What you mentioned is a DataGrid ColumnStyle that shows images. The code the
I need is to make the bitmap from the control.

Suppose I have a hidden TrackBar that I want to show in the column of the
DataGrid. I want to make a Bitmap object from the TrackBar (that is hidden)
and paint the Bitmap in each cell.
How can I make a Bitmap object from the appereance of the control?
Regards

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hamed,

Maybe you can find on this page some stuff that can help you. (It is VB
but that is for most people easily to translate in C# stuff, as far as I
could see is there in the code no part of the VB extensions on the
framework used).

http://www.vb-tips.com/dbpages.aspx?...2-d85153e86736

And you were right, you missed the most propitiate newsgroup for this
question.

Microsoft.public.dotnet.framework.adonet
and the special datagrid newsgroups, but those are mainly inactive.

As I wrote this is not my stuff, Ken is active in the VB newsgroups and
forums, as you ask it there as well, will your question than of course be
answered as well in VB code.

I hope this helps,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:%2******************@TK2MSFTNGP05.phx.gbl...
>I want to inherit my ColumnStyle from
System.Windows.Forms.DataGridColumnStyle

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
Hamed,

It becomes more clear, only there are AFAIK 5 types of Grid's in dotNet,
which one is the one you want to inherit? Not that I know it, but I know
active people in this newsgroup who have done a lot with this kind of
stuff.

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:ue**************@TK2MSFTNGP06.phx.gbl...
Cor

I am partially new in using newsgroups. sorry if this bothered you or
any other here. I just wanted to know if I am sending the question to a
wrong place or not. this is the case.

Anyway, I try to describe the problem in both threads further:

I am developing a ColumnStyle that holds a custom control ( a button or
a numeric up down or something else )

I want to make a property that if set to true (I name it Sparse
property) all cells of the grid is painted by the face of that control.
Since we should implement the Paint method, I want to be able to paint
the face of my custom control in the grid.

Now what is the solution for the above problem?

Regards
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uI****************@TK2MSFTNGP04.phx.gbl.. .
Hamed,

If you don't get an answer than has repeatly asking why that is no
result. You see that in these newsgroups many people try to help as
much as possible. The reason should therefore be in your own question.

There is a chance that nobody (at least for that message me) don't
understand what you are asking.

Better is than to rephrase your message again in the same thread.

As well do people avoid persons who don't give any reaction on
replies, because often people place a question and don't pay any
attention than anymore to the given answers and the work that has done
by that..

This kind of messages you write now is without sence and not liked in
newsgroups, what can give the result that you get not any answer
anymore.

I hope this gives some help,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:u5**************@TK2MSFTNGP03.phx.gbl...
Have I posted the message to wrong newsgroup?
>
Or
>
Does the question is so much strage?
>
Would someone please kindly direct me to a true newsgroup or
resource?
>
Best Regards
Hamed
>
>
"Hamed" <ha***@raymehr.comwrote in message
news:u0**************@TK2MSFTNGP04.phx.gbl.. .
>>Is it possible to get a control (e.g. a checkbox) and make a
>>Graphics
>>object or a Bitmap object of current face of the control?
>>
>The control may be hidden under some other forms or its Visible
>property may
>be set to false. I need to make a Bitmap or Graphics object that
>holds the
>appearance of the control.
>>
>>
>Regards
>Hamed
>>
>>
>"Hamed" <ha***@raymehr.comwrote in message
>news:%2****************@TK2MSFTNGP02.phx.gbl. ..
>>Hello
>>>
>>>
>>I want to implement Sparse property for a ColumnStyle so I need
>>above
>>functionality.
>>>
>>Regards
>>>
>>>
>>
>>
>>
>>
>
>



Aug 15 '06 #13

P: n/a
Thanks Rob.

As I should import it to C#, do you know how can I call BitBlt function in
C#?
"Rob Panosh" <ro********@asdsoftware.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
Hamed,

This is what i use to create a bitmap from a control:

Private Function _renderImageFromControl(ByVal control As
System.Windows.Forms.Control) As System.Drawing.Bitmap

' Get this form's Graphics object.
Dim me_gr As System.Drawing.Graphics = control.CreateGraphics()
' Me._axFramerControl.CreateGraphics

' Make a Bitmap to hold the image.
Dim bm As New System.Drawing.Bitmap(control.ClientSize.Width,
control.ClientSize.Height)
Dim bm_gr As System.Drawing.Graphics =
System.Drawing.Graphics.FromImage(bm)
Dim bm_hdc As IntPtr = bm_gr.GetHdc

' Get the form's hDC. We must do this after
' creating the new Bitmap, which uses me_gr.
Dim me_hdc As IntPtr = me_gr.GetHdc

' BitBlt the form's image onto the Bitmap.
BitBlt(bm_hdc, 0, 0, control.ClientSize.Width,
control.ClientSize.Height, me_hdc, 0, 0, SRCCOPY)

me_gr.ReleaseHdc(me_hdc)
bm_gr.ReleaseHdc(bm_hdc)

' Return the result.
Return bm

End Function

Hope this helps.

Cheers,
Rob

Hamed wrote:
>Cor

I need simply a sparse property that I want to make in my inherited
DataGridColumnStyle class

What you mentioned is a DataGrid ColumnStyle that shows images. The code
the
I need is to make the bitmap from the control.

Suppose I have a hidden TrackBar that I want to show in the column of the
DataGrid. I want to make a Bitmap object from the TrackBar (that is
hidden)
and paint the Bitmap in each cell.
How can I make a Bitmap object from the appereance of the control?
Regards

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hamed,

Maybe you can find on this page some stuff that can help you. (It is VB
but that is for most people easily to translate in C# stuff, as far as
I
could see is there in the code no part of the VB extensions on the
framework used).

http://www.vb-tips.com/dbpages.aspx?...2-d85153e86736

And you were right, you missed the most propitiate newsgroup for this
question.

Microsoft.public.dotnet.framework.adonet
and the special datagrid newsgroups, but those are mainly inactive.

As I wrote this is not my stuff, Ken is active in the VB newsgroups and
forums, as you ask it there as well, will your question than of course
be
answered as well in VB code.

I hope this helps,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:%2******************@TK2MSFTNGP05.phx.gbl...
I want to inherit my ColumnStyle from
System.Windows.Forms.DataGridColumnStyle

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl. ..
Hamed,

It becomes more clear, only there are AFAIK 5 types of Grid's in
dotNet,
which one is the one you want to inherit? Not that I know it, but I
know
active people in this newsgroup who have done a lot with this kind of
stuff.

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:ue**************@TK2MSFTNGP06.phx.gbl...
Cor

I am partially new in using newsgroups. sorry if this bothered you
or
any other here. I just wanted to know if I am sending the question
to a
wrong place or not. this is the case.

Anyway, I try to describe the problem in both threads further:

I am developing a ColumnStyle that holds a custom control ( a button
or
a numeric up down or something else )

I want to make a property that if set to true (I name it Sparse
property) all cells of the grid is painted by the face of that
control.
Since we should implement the Paint method, I want to be able to
paint
the face of my custom control in the grid.

Now what is the solution for the above problem?

Regards
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uI****************@TK2MSFTNGP04.phx.gbl. ..
Hamed,
>
If you don't get an answer than has repeatly asking why that is no
result. You see that in these newsgroups many people try to help as
much as possible. The reason should therefore be in your own
question.
>
There is a chance that nobody (at least for that message me) don't
understand what you are asking.
>
Better is than to rephrase your message again in the same thread.
>
As well do people avoid persons who don't give any reaction on
replies, because often people place a question and don't pay any
attention than anymore to the given answers and the work that has
done
by that..
>
This kind of messages you write now is without sence and not liked
in
newsgroups, what can give the result that you get not any answer
anymore.
>
I hope this gives some help,
>
Cor
>
>
>
"Hamed" <ha***@raymehr.comschreef in bericht
news:u5**************@TK2MSFTNGP03.phx.gbl.. .
>Have I posted the message to wrong newsgroup?
>>
>Or
>>
>Does the question is so much strage?
>>
>Would someone please kindly direct me to a true newsgroup or
>resource?
>>
>Best Regards
>Hamed
>>
>>
>"Hamed" <ha***@raymehr.comwrote in message
>news:u0**************@TK2MSFTNGP04.phx.gbl. ..
>>>Is it possible to get a control (e.g. a checkbox) and make a
>>>Graphics
>>>object or a Bitmap object of current face of the control?
>>>
>>The control may be hidden under some other forms or its Visible
>>property may
>>be set to false. I need to make a Bitmap or Graphics object that
>>holds the
>>appearance of the control.
>>>
>>>
>>Regards
>>Hamed
>>>
>>>
>>"Hamed" <ha***@raymehr.comwrote in message
>>news:%2****************@TK2MSFTNGP02.phx.gbl ...
>>>Hello
>>>>
>>>>
>>>I want to implement Sparse property for a ColumnStyle so I need
>>>above
>>>functionality.
>>>>
>>>Regards
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>>
>
>




Aug 16 '06 #14

P: n/a
I tried to use it in VB.NET but it seems somehow you should define BitBlt
function in VB.NET too.

"Rob Panosh" <ro********@asdsoftware.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
Hamed,

This is what i use to create a bitmap from a control:

Private Function _renderImageFromControl(ByVal control As
System.Windows.Forms.Control) As System.Drawing.Bitmap

' Get this form's Graphics object.
Dim me_gr As System.Drawing.Graphics = control.CreateGraphics()
' Me._axFramerControl.CreateGraphics

' Make a Bitmap to hold the image.
Dim bm As New System.Drawing.Bitmap(control.ClientSize.Width,
control.ClientSize.Height)
Dim bm_gr As System.Drawing.Graphics =
System.Drawing.Graphics.FromImage(bm)
Dim bm_hdc As IntPtr = bm_gr.GetHdc

' Get the form's hDC. We must do this after
' creating the new Bitmap, which uses me_gr.
Dim me_hdc As IntPtr = me_gr.GetHdc

' BitBlt the form's image onto the Bitmap.
BitBlt(bm_hdc, 0, 0, control.ClientSize.Width,
control.ClientSize.Height, me_hdc, 0, 0, SRCCOPY)

me_gr.ReleaseHdc(me_hdc)
bm_gr.ReleaseHdc(bm_hdc)

' Return the result.
Return bm

End Function

Hope this helps.

Cheers,
Rob

Hamed wrote:
>Cor

I need simply a sparse property that I want to make in my inherited
DataGridColumnStyle class

What you mentioned is a DataGrid ColumnStyle that shows images. The code
the
I need is to make the bitmap from the control.

Suppose I have a hidden TrackBar that I want to show in the column of the
DataGrid. I want to make a Bitmap object from the TrackBar (that is
hidden)
and paint the Bitmap in each cell.
How can I make a Bitmap object from the appereance of the control?
Regards

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hamed,

Maybe you can find on this page some stuff that can help you. (It is VB
but that is for most people easily to translate in C# stuff, as far as
I
could see is there in the code no part of the VB extensions on the
framework used).

http://www.vb-tips.com/dbpages.aspx?...2-d85153e86736

And you were right, you missed the most propitiate newsgroup for this
question.

Microsoft.public.dotnet.framework.adonet
and the special datagrid newsgroups, but those are mainly inactive.

As I wrote this is not my stuff, Ken is active in the VB newsgroups and
forums, as you ask it there as well, will your question than of course
be
answered as well in VB code.

I hope this helps,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:%2******************@TK2MSFTNGP05.phx.gbl...
I want to inherit my ColumnStyle from
System.Windows.Forms.DataGridColumnStyle

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl. ..
Hamed,

It becomes more clear, only there are AFAIK 5 types of Grid's in
dotNet,
which one is the one you want to inherit? Not that I know it, but I
know
active people in this newsgroup who have done a lot with this kind of
stuff.

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:ue**************@TK2MSFTNGP06.phx.gbl...
Cor

I am partially new in using newsgroups. sorry if this bothered you
or
any other here. I just wanted to know if I am sending the question
to a
wrong place or not. this is the case.

Anyway, I try to describe the problem in both threads further:

I am developing a ColumnStyle that holds a custom control ( a button
or
a numeric up down or something else )

I want to make a property that if set to true (I name it Sparse
property) all cells of the grid is painted by the face of that
control.
Since we should implement the Paint method, I want to be able to
paint
the face of my custom control in the grid.

Now what is the solution for the above problem?

Regards
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uI****************@TK2MSFTNGP04.phx.gbl. ..
Hamed,
>
If you don't get an answer than has repeatly asking why that is no
result. You see that in these newsgroups many people try to help as
much as possible. The reason should therefore be in your own
question.
>
There is a chance that nobody (at least for that message me) don't
understand what you are asking.
>
Better is than to rephrase your message again in the same thread.
>
As well do people avoid persons who don't give any reaction on
replies, because often people place a question and don't pay any
attention than anymore to the given answers and the work that has
done
by that..
>
This kind of messages you write now is without sence and not liked
in
newsgroups, what can give the result that you get not any answer
anymore.
>
I hope this gives some help,
>
Cor
>
>
>
"Hamed" <ha***@raymehr.comschreef in bericht
news:u5**************@TK2MSFTNGP03.phx.gbl.. .
>Have I posted the message to wrong newsgroup?
>>
>Or
>>
>Does the question is so much strage?
>>
>Would someone please kindly direct me to a true newsgroup or
>resource?
>>
>Best Regards
>Hamed
>>
>>
>"Hamed" <ha***@raymehr.comwrote in message
>news:u0**************@TK2MSFTNGP04.phx.gbl. ..
>>>Is it possible to get a control (e.g. a checkbox) and make a
>>>Graphics
>>>object or a Bitmap object of current face of the control?
>>>
>>The control may be hidden under some other forms or its Visible
>>property may
>>be set to false. I need to make a Bitmap or Graphics object that
>>holds the
>>appearance of the control.
>>>
>>>
>>Regards
>>Hamed
>>>
>>>
>>"Hamed" <ha***@raymehr.comwrote in message
>>news:%2****************@TK2MSFTNGP02.phx.gbl ...
>>>Hello
>>>>
>>>>
>>>I want to implement Sparse property for a ColumnStyle so I need
>>>above
>>>functionality.
>>>>
>>>Regards
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>>
>
>




Aug 16 '06 #15

P: n/a
Hamed,

Sorry forgot to include this code:

Private Declare Auto Function BitBlt Lib "gdi32.dll" (ByVal hdcDest
As IntPtr, ByVal nXDest As Integer, ByVal nYDest As Integer, ByVal
nWidth As Integer, ByVal nHeight As Integer, ByVal hdcSrc As IntPtr,
ByVal nXSrc As Integer, ByVal nYSrc As Integer, ByVal dwRop As
System.Int32) As Boolean
Private Const SRCCOPY As Integer = &HCC0020
Cheers,
Rob

Hamed wrote:
I tried to use it in VB.NET but it seems somehow you should define BitBlt
function in VB.NET too.

"Rob Panosh" <ro********@asdsoftware.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
Hamed,

This is what i use to create a bitmap from a control:

Private Function _renderImageFromControl(ByVal control As
System.Windows.Forms.Control) As System.Drawing.Bitmap

' Get this form's Graphics object.
Dim me_gr As System.Drawing.Graphics = control.CreateGraphics()
' Me._axFramerControl.CreateGraphics

' Make a Bitmap to hold the image.
Dim bm As New System.Drawing.Bitmap(control.ClientSize.Width,
control.ClientSize.Height)
Dim bm_gr As System.Drawing.Graphics =
System.Drawing.Graphics.FromImage(bm)
Dim bm_hdc As IntPtr = bm_gr.GetHdc

' Get the form's hDC. We must do this after
' creating the new Bitmap, which uses me_gr.
Dim me_hdc As IntPtr = me_gr.GetHdc

' BitBlt the form's image onto the Bitmap.
BitBlt(bm_hdc, 0, 0, control.ClientSize.Width,
control.ClientSize.Height, me_hdc, 0, 0, SRCCOPY)

me_gr.ReleaseHdc(me_hdc)
bm_gr.ReleaseHdc(bm_hdc)

' Return the result.
Return bm

End Function

Hope this helps.

Cheers,
Rob

Hamed wrote:
Cor

I need simply a sparse property that I want to make in my inherited
DataGridColumnStyle class

What you mentioned is a DataGrid ColumnStyle that shows images. The code
the
I need is to make the bitmap from the control.

Suppose I have a hidden TrackBar that I want to show in the column of the
DataGrid. I want to make a Bitmap object from the TrackBar (that is
hidden)
and paint the Bitmap in each cell.
How can I make a Bitmap object from the appereance of the control?
Regards

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hamed,

Maybe you can find on this page some stuff that can help you. (It is VB
but that is for most people easily to translate in C# stuff, as far as
I
could see is there in the code no part of the VB extensions on the
framework used).

http://www.vb-tips.com/dbpages.aspx?...2-d85153e86736

And you were right, you missed the most propitiate newsgroup for this
question.

Microsoft.public.dotnet.framework.adonet
and the special datagrid newsgroups, but those are mainly inactive.

As I wrote this is not my stuff, Ken is active in the VB newsgroups and
forums, as you ask it there as well, will your question than of course
be
answered as well in VB code.

I hope this helps,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:%2******************@TK2MSFTNGP05.phx.gbl...
I want to inherit my ColumnStyle from
System.Windows.Forms.DataGridColumnStyle

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2******************@TK2MSFTNGP02.phx.gbl...
Hamed,

It becomes more clear, only there are AFAIK 5 types of Grid's in
dotNet,
which one is the one you want to inherit? Not that I know it, but I
know
active people in this newsgroup who have done a lot with this kind of
stuff.

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:ue**************@TK2MSFTNGP06.phx.gbl...
Cor

I am partially new in using newsgroups. sorry if this bothered you
or
any other here. I just wanted to know if I am sending the question
to a
wrong place or not. this is the case.

Anyway, I try to describe the problem in both threads further:

I am developing a ColumnStyle that holds a custom control ( a button
or
a numeric up down or something else )

I want to make a property that if set to true (I name it Sparse
property) all cells of the grid is painted by the face of that
control.
Since we should implement the Paint method, I want to be able to
paint
the face of my custom control in the grid.

Now what is the solution for the above problem?

Regards
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uI****************@TK2MSFTNGP04.phx.gbl.. .
Hamed,

If you don't get an answer than has repeatly asking why that is no
result. You see that in these newsgroups many people try to help as
much as possible. The reason should therefore be in your own
question.

There is a chance that nobody (at least for that message me) don't
understand what you are asking.

Better is than to rephrase your message again in the same thread.

As well do people avoid persons who don't give any reaction on
replies, because often people place a question and don't pay any
attention than anymore to the given answers and the work that has
done
by that..

This kind of messages you write now is without sence and not liked
in
newsgroups, what can give the result that you get not any answer
anymore.

I hope this gives some help,

Cor

"Hamed" <ha***@raymehr.comschreef in bericht
news:u5**************@TK2MSFTNGP03.phx.gbl...
Have I posted the message to wrong newsgroup?
>
Or
>
Does the question is so much strage?
>
Would someone please kindly direct me to a true newsgroup or
resource?
>
Best Regards
Hamed
>
>
"Hamed" <ha***@raymehr.comwrote in message
news:u0**************@TK2MSFTNGP04.phx.gbl.. .
>>Is it possible to get a control (e.g. a checkbox) and make a
>>Graphics
>>object or a Bitmap object of current face of the control?
>>
>The control may be hidden under some other forms or its Visible
>property may
>be set to false. I need to make a Bitmap or Graphics object that
>holds the
>appearance of the control.
>>
>>
>Regards
>Hamed
>>
>>
>"Hamed" <ha***@raymehr.comwrote in message
>news:%2****************@TK2MSFTNGP02.phx.gbl. ..
>>Hello
>>>
>>>
>>I want to implement Sparse property for a ColumnStyle so I need
>>above
>>functionality.
>>>
>>Regards
>>>
>>>
>>
>>
>>
>>
>
>


Aug 16 '06 #16

This discussion thread is closed

Replies have been disabled for this discussion.