|
Ok, thanks .. I wasn't sure how much change there was between the Beta2 and V1 conversion, but apparently not as much as I thought.
Travis D. Mathison ---
--- After three days without programming, life becomes meaningless ...
|
|
|
|
|
Yes,I think for begining,it is not necessary to upgrade
Travis D. Mathison wrote:
--- After three days without programming, life becomes meaningless ...
nice
Mazy
You can find a solution (even a foolish one) for all problems (even big ones)
|
|
|
|
|
Hi all,
I've a problem with Interoperability with Win32 unmanaged code; my C# program call an unmanaged function in a Win32 DLL and pass a pointer to delegate. This DLL every 20 milliseconds call my C# delegate but the win32 thread finish immediatally after createted. In the win32 function there is one FOR cycle that print a string in output debugger window.
Can you have some suggestion for solve my problem ?
Thanks
|
|
|
|
|
In PrintDialog I changed the "AllowSomePages" to "true".
How can I determine the maximum page number?
Mazy
You can find a solution (even a foolish one) for all problems (even big ones)
|
|
|
|
|
I have a form when I resize the form the size of two text box in it change ,but I don't want it(the others do not change)
thanks
Mazy
You can find a solution (even a foolish one) for all problems (even big ones)
|
|
|
|
|
Look at the Anchor property on the two textboxes. When a form is resized it will resize so that those edges (specified by the Anchor property) are always the same distance from the edge of the container.
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
I examine different Anchors for these "Multiline TextBoxes" but each time they move or resize wrong and hide other controls in the form.
Mazy
You can find a solution (even a foolish one) for all problems (even big ones)
|
|
|
|
|
To keep a control from moving, the Anchor property should be set to (AnchorStyles.Top | AnchorStyles.Left)
This will ensure that the control remains the same distance from the left and from the top.
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
Thanks James,I found it
Mazy
You can find a solution (even a foolish one) for all problems (even big ones)
|
|
|
|
|
One thing that always have confused me is why is the syntax "public class MyCLass" in C#?
What does it mean that "public" in the beginning of a class?
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
"public" is contrasted with "internal".
public classes can be accessed outside of the assembly that contains them. internal classes can only be accessed by other classes in the same assembly.
--
Peter Stephens
|
|
|
|
|
I have written some code in C# and I can't understand why it behaves the way it does.
It is supposed to retrieve the number of seconds that the computer has been turned
on and it looks like this:
PerformanceCounter thePerfCounter = new PerformanceCounter( "System", "System Up Time" );
float systemUpTime = thePerfCounter.NextValue( );
The thing is that it always returns 0.0 and I am pretty sure my computer has been up
for longer than that...
If I call NextValue() a second time it returns the correct uptime though. Does
anyone have any idea why it behaves like this?
thanks for the help
/Mike
|
|
|
|
|
From the docs.
Note If the calculated value of a counter depends on two counter reads, the first read returns 0.0.
My guess is that the uptime counter requires two reads
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
Yes, I have read that note, but it does not make any sense. Why should I have to read a counter twice to get the system up time??
A related question: I am trying to write the same program in managed C++ but the System::Diagnostics namespace does not contain the PerformanceCounter class. Why? Shouldn't the class library be identical beetween the languages?
thanks for the help
/Mike
|
|
|
|
|
I found the solution to my managed C++ problem. I had to add a
#using <System.dll>
to the program. Stupid newbie mistake...
|
|
|
|
|
Hello. I am building a custom web control, and I need to render child controls which are passed as literal strings. I am using ParseControl for this. However, it doesn't seem to be working. When I compile my custom control I get "CS0118 System.Web.UI.TemplateControl.ParseControl denotes a method where a class was expected". My code looks like: this.Controls.Add(new LiteralControl(new System.Web.UI.TemplateControl.ParseControl("<asp:textbox id=\"txt\" Text=\"Person\" runat=\"server\"/>"))); I tried just ParseControl as apposed to System.Web.UI.TemplateControl.ParseControl but when I used ParseControl I got the error "No class or namespace named ParseControl in MyControl, (are you missing an assembly reference?)" But I have System.Web.UI imported into my class. I don't know what to do. Any help is very greatly appreciated.
|
|
|
|
|
ParseControl is a method of TemplateControl which is an abstract class that Page inherits from. You use ParseControl when you want to add a new ASP.NET server control to the page.
void Page_Load(object sender, System.EventArgs e)
{
Button myButton = (Button)ParseControl("<asp:button runat = \"server\"/>");
myButton.Text = "Hello World!";
Controls.Add(myButton);
}
A literal control is used when you wish to insert HTML into your page, not ASP.NET server controls.
If you want to put HTML in your website, use Controls.Add(new LiteralControl(myHTML));
If you want to add a new server control (all server controls have runat="server" in the HTML for them) use the first code example.
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
Thanks alot, but that's not really what I was trying to do.
You see, I'm getting this string for the ASP.NET web controls from a DB. They are dynamic. I don't know wether they will be buttons, labels, dropdownlists, or what.
I am trying to use ParseControl on that literal string. The literal string is the actual code of the ASP.NET web controls, not references to instantiate them or set their properties.
Does that make sense now? I have to find out how to use ParseControl in that sort of instance.
Thanks alot.
|
|
|
|
|
ok, i think i see what you're doing.
In the Page_Load event
Controls.Add(ParseControl(stringFromDB));
You'll have to set all your properties for the control in the string coming from the DB ie <asp:button id="button1" text="push me">
In general you use LiteralControl for static HTML, use ParseControl when you are creating a server control.
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
I'm using the code you provided above, but it still does not work. I'm not doing this in an ASPX page. I am calling ParseControl in a custom web control source (.CS file), that's being compiled into an assembly. And when I compile the assembly, I get the error:
"ParseControl does not exist in the class MyControl"
so I reference it explicitly:
Controls.Add(System.Web.UI.TemplateControl.ParseControl(stringFromDB);
When i compile the assembly I get:
"CS0120: An object reference is required for the nonstatic field, method, or property 'System.Web.UI.TemplateControl.ParseControl(string)'"
I've got to find out how to solve that.
Thank you for all your help.
|
|
|
|
|
ok, now we're getting somewhere
There are only two classes that inherit from TemplateControl, Page and UserControl. So your control is going to have to inherit from one of these (most likely UserControl) to make use of the ParseControl method.
Because ParseControl is not a static method you need an instance of TemplateControl (or a derivative of it) to call it. But TemplateControl is an abstract class so you cannot create an instance of it, leaving you with having to have an instance of one of TemplateControl's derivatives. Out of the box your choices are Page and UserControl.
Is it possible to change your control so it inherits from UserControl instead of Control?
I'll admit I'm no where near up-to-date on ASP.NET as I am C# and the rest of the framework, so I'm just throwing out ideas
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
Thanks for all the help!! ParseControl now works perfectly
|
|
|
|
|
Sorry one more question on jag arrays
how would i get the .Length of each dimension if they vary on the ammount of 'columns'
thanks heaps
|
|
|
|
|
Assuming test is your array and the data stored in the particular row you want is a string.
((string[]) test[myrow]).Length;
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
Hi,
is it possible to have a jaggard array of different datatypes on each row ?
|
|
|
|