|
Yes, use LockBits [^] and unsafe code. (getpixel also does something like that internally, it calls a native method that performs some magic and probably locks the bitmap as well)
|
|
|
|
|
Perhaps this is what you're looking for:
MSDN[^]
|
|
|
|
|
Thanks to both of you for the quick replies, and right on the money with them too.
|
|
|
|
|
Hi everyone,
My datagrid is populating all data. Now i want to add tabs to my WINFORM so that the data can be grouped according to the status_type. Can you let me know how this can be done. I am using Linq to query the database.
Thanks,
|
|
|
|
|
What is status_type? What does Linq have to do with tabs? What will be the purpose of the tabs?
|
|
|
|
|
Status_type relates to my AD Hoc query. It has a list of employees with their current status as "Active" , "In-Active" , "Overseas".....etc. I want to define tabs so that a tab named ACTIVE can list all the employees with the status "Active" and similarly the rest.
Cheers!
|
|
|
|
|
And I suppose you don't want multiple datagrids? Otherwise there wouldn't be any problem at all..
|
|
|
|
|
Hi,
what you could do is this:
- add a TabControl to your Form
- give it any number of TabPages you want
- put one DataGrid(View) on each TabPage
- create a different query for each TabPage
- make sure the queries don't get all launched at once, maybe just get one of them launched by the TabIndexChanged event (plus the initially visible one right away if necessary).
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
hi thanks, can u show me an example for writing queries into tabcontrols
|
|
|
|
|
Huh? A query (SQL, LINQ, whatever) does not care where it is located, it does not look different for a TabControl or TabPage.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Hi,
im binding my datagridview to a datasource (List)
im then hiding a column, but I need to check that the datasource has bound, how do I do this?
thanks
|
|
|
|
|
Debugging? I don't know what exactly you need. Check if the datasource for the gridview is not null.
|
|
|
|
|
ziwez0 wrote: I need to check that the datasource has bound, how do I do this?
Why not checking the DataSource member ..? If it's not null then it's bound to a data source.
Moim Hossain
R&D Project Manager
BlueCielo ECM Solutions BV
|
|
|
|
|
Is the column you are hiding the only column in the DataGridView?
If it is then, I for one, do not understand what it is that you are trying to do!
If it is not, then just run the app. If there's data there the binding worked, if not it might not have.
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.”
|
|
|
|
|
Ah right, I cant hide the column until the databound is complete, (otherwise it throws up wried results)
|
|
|
|
|
Hi,
I am new to c# and getting this:
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
...........................
.........................
any thoughts?
and also what about this?:
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.String.ConcatArray(String[] values, Int32 totalLength)
at System.String.Concat(String[] values)
...........
............
thanks.
|
|
|
|
|
you're out of memory. Do you use image files or videos, or other unmanaged resources ? you need to call Dispose to clean them up, or this will happen. The Garbage collection is actually useless.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
|
Hi,
Are these two separate problems? Please provide some more info.
You might want to show some code (not all of it, just what you deem relevant).
For the last part: how many elements are there in the string array? what is the expected total length after concatenation?
And do you really need the concatenated string? what is going to happen to it? there may be alternatives that are more economical.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
yes separate.
what is the best method? I need to do it to send it somewhere...
|
|
|
|
|
Great. You wrote code that bombs and throw a couple of exceptions. Without seeing the code that generated those exceptions, it's pretty much impossible to tell you where you went wrong.
|
|
|
|
|
here is the invoke code:
<code>
private delegate void SetTextCallback(string text);
SetTextCallback d = new SetTextCallback(SetStatusText);
this.Invoke(d, new object[] { msg });
and for the text the concatenation of strings is with the "+".
|
|
|
|
|
Well that is next to useless.
Where is the code for SetStatusText ?
What is the value of msg ?
One of the Exceptions referred to concatenating strings, you don't think that possibly, just maybe, those strings and the code to concatenate them might be useful to anyone wishing to help you?
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.”
|
|
|
|
|
questions, questions, and more questions.
All the poor chap wants is some simple answers; how difficult can it be.
Please finish your iced coffee and get him out of his misery.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Are you enjoying an iced coffee too?
I cannot give him any sort of answer, much though I'd like to.
I assume that you are composing your answers whilst I am writing this?
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.”
|
|
|
|