|
If you must know.
I posted the message with the following code:
this.SetStyle(ControlStyles.DoubleBuffer & ControlStyles.UserPaint & ControlStyles.AllPaintingInWmPaint, true);
Which of course would not enable the double buffering.
Neil points out my stupid mistake(which I originally had in my other test form, but a monkey came along and changed all the |'s to &'s as a nasty joke, so as you see this was clearly the monkeys fault not mine)
this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
So I see Neil'd observation and hit myself. Well evidently I hit my self so hard that when I went to change it I went into the source of my dummy app in which I was testing the control. So the parent form was double buffered correctly. Thinking that I had enabled it in my control I was sad. So I left it alone until now. And after a break and looking in my code again I relize that the monkeys &'s had not be changed to |'s... If it weren't for the monkey I would have been set.
Joshua Guy Sonork ID: 100.9944
ICQ: 519642
Hotmail: JoshuaJGuy@hotmail.com
|
|
|
|
|
Damned dirty monkeys
James
Simplicity Rules!
|
|
|
|
|
LOL, I hate it when I do that... , Errr, The monkeys I mean...
|
|
|
|
|
using xml, i need to have a wizard (add-in or ui-less control) generate controls and place them on the form.
for instance, the xml reads:
<code>
<controls>
<control tag="DB_COLUMN_NAME">
<name value="Sample"/>
<type value="MyLib.Controls.TextWithLabel"/>
<label value="My Sample"/>
<defaultText value="Enter Text Here"/>
<size>
<width value="200"/>
<height value="34"/>
</size>
. . .
</control>
</controls>
</code>
so when this control loads this xml, it creates a 'TextWithLabel' control and places it on the form as if the user drew the control from the toolbox.
this is a hard topic to search for and i would appreciate any good books/articles on Generative UI development. *like this or more hardcore only please*
|
|
|
|
|
Why don't u use XSL, it's perfect for such task (controls is a pseudo-hierarchical recorset in fact & is enough flat to avoid dirty case).
You should asso look native format .resx (see resgen.exe) which the XML schema of microsoft form. Other tracks:
* Configuration
* Visual Inheritance
* Designer
good luck
|
|
|
|
|
How to convert? (varius methods if possible, please)
|
|
|
|
|
Using atoi will work:
CString str = "42";
int i = atoi(str);
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
it would be cool
|
|
|
|
|
You might even be able to do this through PInvoke, but I wouldn't necessarily recommend it I think I'll stick with "What is Convert?", Alex
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
OOOPS!!!!! I've been in the MFC forum all day and my head is still in that
Use the Convert static functions to do what you want.
string s = "42";
int i = Convert.ToInt32(s);
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
What's the difference between convert and parse.
string s = "42";
int i = int32.parse(s);
|
|
|
|
|
Parse is specific to the Int32 class while Convert is a generic class supporting all types.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
It should also be noted that in the case of converting a string to an int via the Convert class it calls Int32.Parse.
James
Simplicity Rules!
|
|
|
|
|
Good point, James. I'm so accustomed to using the Convert class for everything that I never think about Parse.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
thx... i was looking for this conversion in string class. As I can see there is special class to conversions.
|
|
|
|
|
So I guess my followup question would be when to use one or the other (parse vs. convert). Also, is parse more efficient? Just looking for some guidelines here.
|
|
|
|
|
Convert can convert from all intrinsic datatypes to the other types; parse only accepts strings. Convert also calls the appropriate parse method when converting a string to that format except when converting UInt32 which isn't CTS compliant and converting string to string where it just returns the value .
I would use Convert for consistancy in code, but in some cases, Parse will take a few extra parameters you may wish to use.
HTH,
James
Simplicity Rules!
|
|
|
|
|
How do i create a control that when painted, does not show up on the form, but rather on the bottom like an imagelist does?
|
|
|
|
|
Have your class inherit from System.ComponentModel.Component instead of System.Windows.Forms.Control.
HTH,
James
Simplicity Rules!
|
|
|
|
|
hello,
this by the way is an excellent article. shows how to deal with the CodeDom object. i've been making some use of this object with some success.
i can create the dll and write it to disk. the problem is that i'm trying to write the dll being generated to a directory of my choice.
codeCompiler.CompileAssemblyFromSource(compilerParamaters, sourceWSProxy);
this line automatically generates the dll in the bin\Debug of the application directory. i can't seem to over ride this.
hope someone can help with this one.
thanks
Orion
Orion
|
|
|
|
|
Um, what article?
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
This one
James
Simplicity Rules!
|
|
|
|
|
hello Tom,
if you search this site for ICodeCompiler or CodeDom you should get a couple of articles. one by Konrad Rotuski "C# Compiler" and the other by Shawn Wildermuth "Runtime C# Expression Evaluator
". both are basically the same.
here's the link to the first one.
http://www.codeproject.com/csharp/cscompiler.asp
thanks
Orion
|
|
|
|
|
Yeah. I know where the article is.
The subtle point was to let you know that you need to include links like this instead of assuming the people helping out here have the time to go searching for them
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
your right. my apologies
did you need any other info?
the ICodeCompiler doesn't have any properties i can set. and the dll will be written before its assigned to the CompilerResults object.
ideally i'd like to write it to the MS temp directory.
Orion
Orion
|
|
|
|