|
Hi, sorry if I have missed or not read all of your Tab Articles, but I never see a example of maybe doing the paste/copy command when a user is allowed to create their own tabs with text boxes in them. Since they are in a array under the name of newRtb it gets confusing how to allow the user to lets say paste information on a selected tab with a Rich Text Box in it.
Any suggestions on what to do? I do have code, but it does not work...
private void Cut(object sender, System.EventArgs e)
{
int index = this.Controls.IndexOfKey("newRtb");
if (index != -1)
{
Control control = this.Controls[index];
RichTextBox richTextBox = control as RichTextBox;
if (richTextBox != null)
{
richTextBox.Cut();
}
}
}
I am completely lost on how to do this and this is the only thing stopping me from finishing my program I made.
Thanks, Ajm113
-- modified at 12:04 Wednesday 10th October, 2007
|
|
|
|
|
Hi!
When I try to serialize a object that has a TimeSpan property that property is serialized as if it is null even if it was set.
Can anyone help me?
Thanks,
Lukas
|
|
|
|
|
Are you using the XmlSerializer? If so, then check this[^] out.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
|
See my reply to that thread.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi,
I have to following nagging problem. I have a normal form where i put at runtime a usercontrol. This usercontrol has a property called RE_ID. when adding the usercontrol to the form
<br />
usxClientDetail objControl = new usxClientDetail();<br />
objControl.Dock = DockStyle.Fill;<br />
this.tabPage1.Controls.Add(objControl);<br />
<br />
i would like to call that property so the usercontrol gets filled with the correct data. But there is no way i can access that
<br />
<br />
foreach (UserControl ctrl in tabPage1.Controls)<br />
{<br />
if (ctrl.Name == "usxClientDetail")<br />
{<br />
foreach (Control ct in ctrl.Controls)<br />
{<br />
MessageBox.Show(ct.Name.ToString());<br />
}<br />
}<br />
}<br />
i can loop through everything but not through the propertycollection. At least it seams ...
any ideas suggestions how to access that public property on the form at runtime is welcome :->
Kind regards,
Marcel Vreuls
http://www.marcelvreuls.com
< >
|
|
|
|
|
You can use the "is" keyword and cast it to the appropriate type, like so:
foreach (UserControl ctrl in tabPage1.Controls) {
if (ctrl is usxClientDetail) {
usxClientDetail clientDetail = ctrl as usxClientDetail;
}
}
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Thanks that works. I costed me 2 hours today en asking at CP 5 minutes ..
again thnx.....
Kind regards,
Marcel Vreuls
http://www.marcelvreuls.com
< >
|
|
|
|
|
Hi friends
I wrote follow code to send an image in network:
<br />
BinaryWriter myBR = new BinaryWriter(MyNetworkStream);<br />
myPic.Save(MyMemoryStream, System.Drawing.Imaging.ImageFormat.Jpeg);<br />
byte[] arrImage;<br />
arrImage = MyMemoryStream.GetBuffer();<br />
myBR.Write(arrImage);<br />
And this for receive it:
<br />
MemoryStream memstr = new MemoryStream();<br />
byte pic;<br />
BinaryReader br = new BinaryReader(myNetworkStream);<br />
bool loop = true;<br />
while (loop)<br />
{<br />
try<br />
{<br />
pic= br.ReadByte();<br />
memstr.WriteByte(part);<br />
}<br />
finally<br />
{<br />
loop = false;<br />
}<br />
}<br />
byte[] picture = memstr.GetBuffer();<br />
but in receive part, when it arrive to "pic = br.ReadByte();", it do no thing and there is no error.
can you tell me what is incorrect code?
|
|
|
|
|
Maybe I'm not understanding your problem, but why are you using a binary reader? Just use myNetworkStream.ReadByte()
|
|
|
|
|
An array of bytes is not represented the same way as individual bytes by the BinaryWriter. You can't write the data as an array and read it as individual bytes.
Why are you using a BinaryWriter and BinaryReader at all? Why not write and read the data directly?
---
single minded; short sighted; long gone;
|
|
|
|
|
Your loop existsexits on the first loop every time. Finally is always executed after a try block. What you intended was likely catch{loop = false;} but you need a different understanding of streams, instead.
byte[] bytes = new byte[255;]
while((bytesRead = stream.ReadBytes(bytes, 0, bytes.Length)) != 0)
otherStream.Write(bytes, 0, bytesRead);
is a better construct for copying a stream to another. (255 is arbitrary)
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Dear gurus,
is it possible to download the complete net-framework-3.0-sdk from anywhere (e.g. as a zip-file)?
If I try to download it from micrsoft, than I only get a small "setup.exe". This one seems to start some downloads by itself in background during installation.
In advance:
Thanks for your advices
|
|
|
|
|
On this[^] page under Instructions you can download the redistributable packages that contains the entire framework instead of just a bootstrapper.
|
|
|
|
|
Thanks for your help!
The site you recommended contains only the redistributable package. It is not the complete SDK.
Is there also any site?
Thanks !
|
|
|
|
|
Here?[^] Click the "Continue" button next to "validation required" and a DVD image file will become available for download in the Instructions section - if your Windows validates properly. Is that what you're looking for?
|
|
|
|
|
Hallo,
yes it is what I was looking for.
With kind regards
and thank you
|
|
|
|
|
Hi,
I have some win form application - and on the Form i have some UserControl that i wrote -
On the Form i define some button to be as "AcceptButton" ( button of the Form and not the button that is on the userControl ).
Now ... when the form is up i always get one of the userControl button as the "AcceptButton" and not the button that i define.
This happen only on one of the userControl - other userControl work fine.
What to do ?
Thanks for any help.
|
|
|
|
|
hi all
In my application, i have a treeview consisting of some nodes. when i click a node, i am generating some images
and displaying them in a listview.
i am storing the images temporarily in a folder in the application path.
so everytime a node is clicked,
i need to remove the original images and add the new images.
when i tried to delete the contents of the folder, it says file is in use(which is obvious).
Can anybody suggest me ideas as how to remove the old images from the folder?
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
You must have forgotten to close the filestream or something. So all you need to do is make sure you Close() all your streams before deleting all your files.
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
hi,
thanks for your reply. but i am not using filestream class at all.
i used the following code.
foreach (File file in Directory.GetFiles(path))
{
File.Delete(file);
}
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
"i am storing the images temporarily in a folder in the application path"
Does that not mean that your creating a new files, and writing to them during runtime? Because if it does, once youve written the file, you need to close the stream.
If the files are already there, then unless you've got them open somewhere, or explorer has them open. They should just delete fine.
If its the latter, go download 'unlocker' and see whats holding your files hostage.
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
i think u shuld check the permission of the Folder in which u are storing ur image file.Give the permission of write also.
May be it will work for you. or i m not getting ur question
Thanks and Regards
Aavesh Agarwal
|
|
|
|
|
Im not sure, but what you can do is make sure that your byte array isn't empty. And if thats OK, once you set up your memory stream, make sure that it also, is not empty.
Now, im not savvy with sql databases and whatnot, but, could you not do something like this:
Bitmap img = (Bitmap)cmd27.ExecuteScalar();
pictureBox1.Image = img;
My current favourite word is: Waffle
Cheese is still good though.
|
|
|
|
|
Waffle, thanx for your response...i tried what u said, bud it did'nt help.
|
|
|
|