|
I dont think there is any inbuilt function for these
you need to do it manually
Paras Kaneriya The difference between genius and stupidity is that genius has its limits.
|
|
|
|
|
Hello,
this[^] looks promising!
All the best,
Martin
|
|
|
|
|
There is no direct conversion.
First parse the decimal string into a numeric value. Example:
string dec = "123";<br />
int num = int.Parse(dec);
Then format the number into a string in hexadecimal format. Example:
string hex = num.ToString("x");
You can specify the number of digits you want in the hexadecimal number:
string hex = num.ToString("x4");
---
single minded; short sighted; long gone;
|
|
|
|
|
int value = 15;
string hex = string.Format("{0:x2}", value);
Console.WriteLine(hex);
Console.ReadKey();
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
My program needs to create a child process to execute some task in.
What should I use for the communication between the parent and child process?
Using .NET Remoting with TcpServerChannel displays a Windows Firewall warning. It is an requirement that no such warning is displayed. I get no warning if I use a TcpListener with LocalAddress=IPAddress.Loopback, but how can I use that TcpLiostener with remoting?
Optimal would be if I could use .NET remoting around a stream I create myself. I don't want the discovery / re-build lost connection / etc. features.
|
|
|
|
|
Hi Daniel,
Have you looked into named pipes? There is a codeproject article[^] (multiple parts) on it.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Named pipes just give me a stream like I get with TcpClient, but how can I use .NET Remoting on a stream?
|
|
|
|
|
There is an article on doing that here[^].
If you are not tied to .Net Remoting, you could also simply serialize the object you wish to send to an array of bytes, send the bytes over to the child process, and then deserialize the object. This would require that both the parent and child process have visibility (e.g. reference) to the object type. Where as with remoting a proxy object (that doesn't actually have any implementation) could be used by the child.
Let me know if this helps or not.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi,
I have an mdi program.for this program I must use splitContainer so when I want to show child form it doesn’t appear however child form was created. So for solving this problem I added child form to the splitContainer panel. My code is like this:
<br />
Form1 frm=new Form1();<br />
frm.MdiParent=this;<br />
splitContainer.Panel1.Controls.add(frm);<br />
frm.show();<br />
Now my child form was shown but when it gets focuses its titlebar was inactive yet. I mean it gets focuses but the child form titlebar doesn’t change to be active.So user who will work with this program doesnt know if it gets fouses or not.
What is my wrong for this happening?!
Does it another way to show child form when we have splitContainer in mdi Programs?
|
|
|
|
|
You're using two things that cannot work together. You're treating the child form as both and MDI child and as a Control. You only do one, not both.
If you're going to put this form into a Panel control, you have to treat it as a Control and not a form that has no parent (or the parent is the Desktop window.) You cannot have it as an MDI Child. But, in order to treat it as a Control, you have to tell the form that it is no longer a top-level form.
Form1 frm = new Form1();
frm.TopLevel = false;
splitContainer.Panel1.Controls.Add(frm);
|
|
|
|
|
Hi
Tell me what should be the best format for recording as well as transmission of video over LAN.As in my application case vidoe format is .avi but for transmission it is 2much heavy.
Try to Reply ASAP
Regards,
Shanzay
|
|
|
|
|
DeepOceans wrote: .avi but for transmission it is 2much heavy.
It's not really that bad, unless someone has dial-up. Maybe do something with breaking the .avi into smaller chunks and stream it.
"Try asking what you want to know, rather than asking a question whose answer you know." - Christian Graus
|
|
|
|
|
Hi all,
Can anyone give a tip on how to construct this array, or something with the same effect?
Each row in the array will have two columns containing string values, and a third column which is an array of strings. Each row might have different numbers of values in the third column's array.
Thanks,
Jason
-- modified at 5:04 Tuesday 25th September, 2007
|
|
|
|
|
Well, you could create your array with [n][3] dimensions. However, a better bet would be to create a class which encapsulates the items in your list, and then wrap it up with a generic list. Modified in response to your changed requirements:
public class MyClass
{
private string _field1;
private string _field2;
private List<string> _field3 = new List<string>();
public string Field1
{
get { return _field1; }
set { _field1 = value; }
}
public string Field2
{
get { return _field2; }
set { _field2 = value; }
}
public List<string> Field3
{
get { return _field3; }
set { _field3 = value; }
}
}
... private List<MyClass> list = new List<MyClass>();
public void Add(MyClass item)
{
list.Add(item);
}
-- modified at 7:20 Tuesday 25th September, 2007
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I like to do a function in my Form that do a “print screen” on the whole form and saves it to a jpg-file.
_____________________________
...and justice for all
APe
|
|
|
|
|
|
You may take picture of whole form using DrawToBitmap function of Form and put it in a Bitmap object. After this you save it using save method of Bitmap object.
Following is a code snippet showing this-
------------------------Start Code----------------
Bitmap bmp1 = new Bitmap(this.ClientRectangle.Width, this.ClientRectangle.Height);
this.DrawToBitmap(bmp1, this.ClientRectangle);
bmp1.Save("C:\\FormImage.jpg");
-------------End Code-----------------------------
I hope this helps .
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Hmmmm... I only get a printscreen of the form itself. Not its subforms...
_____________________________
...and justice for all
APe
|
|
|
|
|
Yes because in the previous code DrawToBitmap function of a particular Form was used, this will return image of only one form.
However if you have multiple Forms on screen and you want to take image of whole screen, you may try following code which uses CopyFromScreen function and it will return image of every thing which is on screen –
int wth, ht; //modify width and height as per need
wth= 1000;
ht= 900;
Bitmap bmp2=new Bitmap(wth,ht);
Graphics grp = Graphics.FromImage(bmp2);
Point x1=new Point();
Point x2=new Point ();
x1.X=0;
x1.Y=0;
x2.X=0;
x2.Y=0;
Size sz = new Size(wth, ht);
grp.CopyFromScreen(x1,x2,sz, CopyPixelOperation.SourceCopy);
This should give you what you want. Let me know the result .
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Result:
_____________________________
...and justice for all
APe
|
|
|
|
|
|
|
Martin# wrote: Hope it helps!
Yes it did.
Thanks a bunch.
-- modified at 5:35 Tuesday 25th September, 2007
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
|
|
|
|
|
Hi all,
I have a class which inherit from System.WindowsForm.UserControl and an interface (with a method named Update)
I want to implement the Update method of my interface and not the user control method
is there a way to do that ?
like in C++ void Interface::Update() ?
Thanks in advance
|
|
|
|
|
You can have two update methods.
public void Update()
{
}
public void IMyInterface.Update()
{
}
MyControl control = GetControl();
control.Update();
((IMyInterface)control).Update();
The version called depends on what you have a reference to. If you have a reference to the class or one of its bases then the Update() method will be called, if you have a reference to the interface the IMyInterface.Update() will be called.
|
|
|
|