|
In Solution explorer, chose the projet you wish to shsre the file TO., right click and choose add->existing item.
browse to the file you wish to share and select it. BEFORE CLICKING THE ADD BUTTON, click the down arrow on the right of the add button, and choose "add as link" from the drop down. The selected file will now be shared to your project, rather than copied to it...
Who'd a thunk it - button cross bred with a combo. Took me for ever to stumble across that non-intuitive POS.
|
|
|
|
|
I have afew questions regarding the tab page control:
1) I have to force the user to not change the page untill a database is loaded. I used the invalidating event to force the user not to change focus untill the dataset is loaded. the only problem is:
i don't kow how to put the condition: dataset.tables.count!=0 is right??
and
does the validating event actually worg between tab pages?
2) I want certain tab pages to be either disabled (I mean to appear on the tab control disabled, not all the controls on it to be disabled) or invisible(likevise)
how do i do that?
rzvme
|
|
|
|
|
rzvme wrote: i don't kow how to put the conditio
1)If you use .Net 2.0 there is an event called DataSet.Initialized, and a property called DataSet.IsInitialized. When the Dataset finishes initialization, the event fires, and the property is set to true.
rzvme wrote: 2) I want certain tab pages to be either disabled (I mean to appear on the tab control disabled, not all the controls on it to be disabled) or invisible(likevise)
how do i do that?
2) I don't think I caught up with you, but if I got you right, then you don't want to hide, nor disable the tabpages and the inner controls, yet you still don't want to allow changing the current page. You can handle TabControl.SelectedIndexChanged event, and check IsInitialized in it. If it wasn't true, revert the selected index to the page you desire.
Regards
|
|
|
|
|
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
|
|
|
|