|
[using SWF;]
int i = 20;
txtBox1.Text = i.ToString();
txtBox2.Text = i.ToString("x");
Greets,
Daniel
|
|
|
|
|
Thanks... This seems like a more straight forward method
Weiye, Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
How do I emulate a union structure in C#?
|
|
|
|
|
Anonymous wrote:
How do I emulate a union structure in C#?
Note the attributes StructLayout and FieldOffset .
[StructLayout(LayoutKind.Explicit)]
public struct SampleUnion
{
[FieldOffset(0)] public bool Flag1;
[FieldOffset(1)] public bool Flag2;
[FieldOffset(2)] public bool Flag3;
[FieldOffset(3)] public bool Flag4;
[FieldOffset(0)] public long Composite;
}
-Nick Parker
|
|
|
|
|
Thanks. So for the BE_CONFIG union in the LAME api I should just start every inner struct at FieldOffset(0)?
|
|
|
|
|
Shouldn't the Composite member be of type Int32 (int )? Long s in C# are aliases to Int64 s.
[edit] I guess you could use a long if you'd like because this is a union (also only a sample ).Just the first four bytes of the long will be used when dealing with the booleans.
Also remember that these unions in C# are not CLS compliant. [/edit]
-Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
Nathan Blomquist wrote:
Shouldn't the Composite member be of type Int32 (int)? Longs in C# are aliases to Int64s.
I suppose it would be a "best programming practice", however because in C# a long maps to System.Int64 I am o.k.
-Nick Parker
|
|
|
|
|
Yeah what exactly does cls compliant really mean? Is that the same as a Microsoft Certified Professional?
|
|
|
|
|
grv575 wrote:
what exactly does cls compliant really mean?
It means that the publicly exposed interface for the member/type/assembly follows the Common Language Specification (CLS).
Some things that aren't CLS Complaint: Unsigned integer types (C#), varying public items by changing just the case of the name (like public int Foo and public int foo ).
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
I'm looking for class or even just tips on how to get this done. I want to convert targa image files to either .jpg or .gif (generally something that will display properly on website). I'm not overly advanced in using C# but if given good enough pointers I could probably pick it up, though finished class would be better, I learn best from examples too
|
|
|
|
|
Following a selection I am generating a report in pdf format saving it to the server and then displaying it to the user using the folling code that runs at the end of the btnClick event.
scriptstring= "mywindow = window.open('" + rPath + "','" + sWindow + "','height=350,width=532,toolbars=no,resizable=no')" + "<" + "/script>";
RegisterStartupScript("Startup", scriptstring);
The problem is that the report is displaying under the page rather than on top of it. How can I accomplish this?
Thanks
|
|
|
|
|
Does any one know if it is possible to add a form to a panel? Thanks
|
|
|
|
|
I don't think so...
You should use a UserControl...
HTH
Shaun
|
|
|
|
|
I have an mdi application where the parent window is split in two horizontally. So I have a left side and a right side and the left side is part of the parent window. The left side contains navigation which determines which window will be displayed on the right hand side. But I want the max size of the children window to be no bigger than the area on the right hand side. Right now the children window overlaps the left hand side.
|
|
|
|
|
zuhx wrote:
Does any one know if it is possible to add a form to a panel?
Yes, it is possible, but not really recommended unless you change the FormBorderStyle.
MyForm form = new MyForm();
form.TopLevel = false;
form.Location = new Point(5, 5);
this.Controls.Add(form);
form.Show(); The only two things you HAVE to do is set TopLevel to false, and call Show . Don't forget that if the user clicks the close button on the form then the form object get's Dispose'd -- yet another reason to change the forms FormBorderStyle or at least hook the form's Closing event.
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
James T. Johnson wrote:
Yes, it is possible, but not really recommended unless you change the FormBorderStyle.
I do need to change the FormBorderStyle. Can you give a little more detail on why it is not recommended? Is it only because of changing the FormBorderStyle or are there other reasons as well?
|
|
|
|
|
zuhx wrote:
Can you give a little more detail on why it is not recommended?
I don't recommend adding a form to a panel UNLESS you change the border style. Otherwise you wind up with a form that can be moved around (not so bad if that is the intended purpose) but it can also be closed which can be a problem.
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
I am writing a compiler using C# and the System.Reflection.Emit classes. The problem I am having is that I go through and create my classes for my language using TypeBuilder but I can't use those classes until I call CreateType. This wouldn't be a problem except that I potentially have to define instances of the class within the class (and therefore before I call CreateType). An example of this would be a linked list node that contains an instance of itself as the next node.
So the real question is if there is some way to get the System.Type of a TypeBuilder before calling CreateType. Or alternately, is there some way to add functions and variables to an already created type that I still have the TypeBuilder for but have called CreateType? I need this because many things need a System.Type and I need to allow users to use the classes they create while programming.
Thanks
|
|
|
|
|
I feel your pain. I abandoned IL , and went with codedom. , but I believe inheritance will solve your problem here.
<a TITLE="See my user info" href=http:
|
|
|
|
|
Hmm, TypeBuilder itself is derrived from Type, perhaps that's what you need.
I also see the following remark in the documentation for TypeBuilder:
To retrieve a Type object for an incomplete type, use ModuleBuilder.GetType with a string representing the type name, such as "MyType" or "MyType[]".
Burt Harris
|
|
|
|
|
How do I find out if the system is hiding shortcut keys?
So I know how to draw the text on the button control.
If there is some simple way that I have overlooked let me
know.
Thanks You
Bo Hunter
|
|
|
|
|
Refer to the ShowKeyboardCues property on the Control class. There are a few events you should handle as well in case the user's preference has changed. The above property has some other topics in the "See Also" section that you should reference.
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
I'm using a WebControl TreeView and whenever I add nodes, (reguardless if I add them in the C# code, ASP code, or using the TreeView properties) they show up as just plain text. I tried openeing a whole new project, thinking it was someting wrong with the project I added it to, and adding it as a Web Control, neither worked. Any help would be greatley appriciated.
.............Zack.............
Developer Extraordinaire
&&
Full Time Geek
"It's all about function over form. I mean, look at NASA. Their code isn't formatted correctly and their stuff looks crappy, but they'll get you to the moon."
"And the geek shall inherit the earth..."
GCS\P\SS d- s-:- a-- C++$ U--- P--- L- E- W++ N o K-? w+++ O++ !M-- V PS+ PE Y+ PGP t+ 5+ X+ R++ tv++ b++ DI++ D+++ G+>G++++ e* h- r++ y+
|
|
|
|
|
gah! I replied once before but CP said there was an error, this time it doesn't look like the message was still posted.
Your post triggered something in my memory, but I don't know what exactly. I think someone else may have had similar problems on the DOTNET lists. I did a quick search but couldn't find it, but maybe you can come up with some better hits.
http://discuss.develop.com[^]
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
Hey All,
I remember in vb6 you were able to make a single control like a button, visible on all tabs of a tabbed control by holding down alt or something like it while your throwing the control on the form. Does anyone know if this exists in .net?
Thanks,
Ryan
|
|
|
|