|
1) you may write :dataset.tables[tablename].Rows.count!=0
2) tabpagechange event can handle this.
Sorry ...
|
|
|
|
|
yes, but how do i get the page(index or name) from wich the index/name was chaged? the tab control doesn't have a last selected page or last selected index property.
Another problem is the fact, i think, the tabcontrol selected index changed occurs after the tabpageenter event.
-- modified at 1:48 Sunday 29th October, 2006
rzvme
|
|
|
|
|
in the namr og god
hi.
where i can get (ocr) for programing in mysoftwar?
tankyou.
|
|
|
|
|
You mean you want to make your program an OCR engine? In what language? The easiest way is to use office interop if it has OCR in it. Otherwise you'd have to buy an OCR component.
Regards
|
|
|
|
|
Hi There....
I am looking to iterate through A form's Controls collection. However i am also interested in control which are the child of panels. Is there any built support in WinForms? Or is the solution just to write my own little recursive method?
Thanks in advance
Aj
|
|
|
|
|
Hi,
yes recursion is the way to go:
private void LoopThroughControls(Control c) {
foreach (Control subControl in c) {
LoopThroughControls(c);
}
}
Within your Form just call: LoopThroughControls(this);
Robert
|
|
|
|
|
Thanks Robert - Quite an elegant little solution there....
|
|
|
|
|
private void button3_Click(object sender, EventArgs e)
{
treeView1.Nodes.Add(LoopThroughControls(this));
}
private TreeNode LoopThroughControls(Control c)
{
TreeNode node = new TreeNode(c.Name);
Control ctemp;
for(int i=0;i<c.controls.count;i++)
{
="" ctemp="c.Controls[i];
" if="" (ctemp.haschildren)
="" node.nodes.add(loopthroughcontrols(ctemp));
="" }
="" else
="" node.nodes.add(ctemp.name);
="" return="" node;
="" }
if="" you="" want="" to="" write="" xml="" for="" all="" propertys="" of="" controls="" form="" ,="" i="" may="" do...=""
<div="" class="ForumSig">Ok ...
|
|
|
|
|
What exactly are you trying to tell me with this?
Robert
|
|
|
|
|
hi,
i would like to know how i can communicate from e.g. windows shortcuts or context menu items in windows to my program ...
i think i will have a installer finally creating these and adding some registry values and they should e.g give me the location where e.g. the windows explorer is active atm ... ?
something like a context menu extension...
dont know where start searching ...
thanks a lot!
cheers phil
|
|
|
|
|
I think you mean shell extensions.
These series of articles may be a good start. Click here[^].
Regards
|
|
|
|
|
that the code i wrote
FileStream w = new FileStream("d:\\HufmanCompression.txt",FileMode.Create);
BinaryWriter writer = new BinaryWriter(w);
for (i = 0; i < array.Length;i++ )
writer.Write(array[i]);
w.Close();
The output i need is to write a binary file with a very small size(it is a compression prog)
thanx for ur time
|
|
|
|
|
And the problem is...?
---
b { font-weight: normal; }
|
|
|
|
|
I don't seem to see a question in your message? What's your problem exactly? Your code is one way of doing it. What's wrong with it?
Ps.
Make sure to call writer.Flush() at the end of your code before slocing the stream.
Regards
|
|
|
|
|
Doesn't Close flush the stream?
|
|
|
|
|
Well, in his case Close() will flush the FileStream , but not the BinaryWriter . So I suggested that he'd call writer.Flush() to flush the BinaryWriter too.
Regards
|
|
|
|
|
But he's closing the writer. That flushes the writer, closes the writer, flushes the stream and closes the stream.
---
b { font-weight: normal; }
|
|
|
|
|
IIRC he called
w.Close();
and w is the FileStream. How does that close the BinaryWriter -named in his code writer -?
Regards
|
|
|
|
|
Yes, you are right in that. I didn't read the code thorougly enough, and was confused by the naming of the variables and what the code really should have been doing. He closes the stream when he should really close the writer instead.
The best way is of course to close the writer, not the stream:
writer.Close();
If you close the stream, you can solve the problem with the buffering in the writer by flushing the writer first, but it still leaves the writer in a confused and unusable state when the stream is closed.
---
b { font-weight: normal; }
|
|
|
|
|
Hi
I want to get sql server table fields Description, I want to use them for my datagrids header text.
So how can i get field description from database table?
Tanks
|
|
|
|
|
freshonlineMax wrote: I want to get sql server table fields Description
What makes you think there ought to be one? Take a look at DataColumn class in your documentation, you'll see it has no description member. I usually name my columns in the database in a human friendly way so that I'd name the DataGridColumns with the same string using a loop -with some modifications of course like removing underscores-.
Regards
|
|
|
|
|
Just because the DataColumn class doesn't have such a property doesn't mean there is now way to get this info...
Robert
|
|
|
|
|
Robert Rohde wrote: doesn't mean there is now way to get this info...
And what other ways do you know to get that information? Also when you make a Sql table where do you put that information?
Regards
|
|
|
|
|
Dear Nade Elshahabi
Please don't answer your friend's questions with an another question and let others to help and show the best way.
I had a code to fetch database informations, but i lose it in my harddisk.
If you don't have information about a subject you don't have to answer.
I know you want to help, but others me be think, my problem have been solved.
Regards
|
|
|
|
|
freshonlineMax wrote: Please don't answer your friend's questions with an another question
I wasn't asking for an answer. I was proving my point of view that there is no description for Sql columns. If Robert knew how to get it he would have posted the answer. BTW where did you put that description anyway?!!
freshonlineMax wrote: I had a code to fetch database informations, but i lose it in my harddisk.
Database information?? You mean that present in the INFORMATION_SCHEMA? Check the INFORMATION_SCHEMA.COLUMNS table and see if it has a description field!!
freshonlineMax wrote: If you don't have information about a subject you don't have to answer.
freshonlineMax wrote: I know you want to help, but others me be think, my problem have been solved.
Sure! And forgive me -turely- if I blocked someone else from answering you. Your post is still there. He who has answer, let him benefit us all!!
-- modified at 14:26 Saturday 28th October, 2006
Regards
|
|
|
|