|
Actually I have a xsd file from which I autogenerate a .cs file containing all class definations.I need to change my xsd often,so the members of the class often changes.And I want to initialise the members at run time whose name I can specify through a string str.suppose I set str="call".Now I want to set myobject.call=value.Please help.
bidisha
|
|
|
|
|
Then you need to have a look at some of the stuff in the System.Reflection namespace. Start with typeof(MyClass) which returns a Type object and from there you can enumerate all sorts of things like the properties in a class, you can then invoke them in order to set the value of the property and so on.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
I have used FieldInfo.setValue to set the fields where FieldInfo.Name=my_specified_name.
I have no problem with setting the field value with primitive datatype such as string or int.But some field are of user defined datatype.For example, I have a field as
Call mycall;
where
public class Call
{
string calltime;
string callvalue;
}
I cant reach to mycall.calltime using FieldInfo.
bidisha
|
|
|
|
|
I've inserted CheckBoxes to a RichTextBox using RichEditOLE's InsertObject() function. But when i try to check the CheckBox, it selects the CheckBox on the first Click and checking is done only on double clicking the CheckBox. Moreover it takes only MouseDown and Click Event. No other events are handled. Any ideas to solve this?
Linda Thomas
|
|
|
|
|
Hi all
can anyone tell me how to draw a line without flickering the screen
Thanks
Pramod
|
|
|
|
|
In your constructor (of the control that is drawn upon):
base.Setstyle(ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint);
Did this from the top of my head, so maybe the enums are not spelled correctly, but it should point you in the right direction.
Also make sure you do the painting in OnPaint , not GreateGraphics .
HTH!
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick || Fold With Us! || Pensieve || VG.Net ||
|
|
|
|
|
Hi Marc,
Thanks for the suggestion
but i am using a RichtextBox and it does not has a
setStyle method
any other suggestions will be appreciated
Waiting for your quick reply.
Thanks
Pramod
|
|
|
|
|
RichTextBox does have a SetStyle method (it is inherited from Control ), but it is protected so only accessible from a derived class.
As was suggested above, to get the functionality you require you must inherit from RichTextBox , set the relevant style flags in your constructor and do your painting in the overriden OnPaint method. Im pretty sure you are using Graphics g = Graphics.CreateGraphics(yourRTBInstance) to draw, which in this case is the wrong way.
-- modified at 8:29 Wednesday 11th January, 2006
|
|
|
|
|
Oh yeah it's protected, i had forgotten that
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick || Fold With Us! || Pensieve || VG.Net ||
|
|
|
|
|
Hi,
can anyone of you send me the code please
Thanks
PRamod
|
|
|
|
|
Hi,
CAn u send me the code
Thanks
Pramod
|
|
|
|
|
Hi Marc,
i got it and now the drawing is done fine but still some flickering
is there.
This has also caused one more problem\, Due to this code
now if i type something in the Richtextbox it does not shows the text
instead white spaces are shown
any suggestions to avoid this
Thanks
|
|
|
|
|
I have no experience with RichTextBoxes, only owner-drawn controls, so i dont think i can help you that much. You can try fiddling with the SetStyle flags.
base.Setstyle(ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);
base.Setstyle(ControlStyles.DoubleBuffer, true);
or
base.Setstyle(ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
or
base.Setstyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint, true); Sorry i can't help you any further...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick || Fold With Us! || Pensieve || VG.Net ||
|
|
|
|
|
i tried all the options but none of them are working for me
Anyways Thanks for the suggestions
Pramod
|
|
|
|
|
Did you try this?
public class MyRichText : RichTextBox
{
public MyRichText()
{
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
SetStyle(ControlStyles.ResizeRedraw, true);
SetStyle(ControlStyles.Selectable, true);
}
}
Jordan
|
|
|
|
|
I set the connection with fax modem using At commands:
(
at+fclass=1
atdt<tel number="">
at+fth=3
at+fts=8
at+ftm=96
at+fth=3
at+ftm=96
)
and after last command I need sending the page image data. Does anybody know how to send this data by writing to COMport? Which encoding I should use, in what format it should be wroten to COMport?
Thanks
SAns
|
|
|
|
|
Hi,
I had created setup files for the project which i worked on. So the user has to install the setup and run the application. The next time i give him the new setup of the same project, then he'll have to uninstall it from 'Control Pane->Add/Remove Programs'.
Is there a way by which he need not uninstall again and again i give him new setups, but just update it??
please can anyone just help me out here??
|
|
|
|
|
|
Hi!
There's a setting somewhere in the setup project to "check for newer version". You'll also have to increment the version of your project or windows installer will tell you that this particular version is installed already.
Regards,
mav
|
|
|
|
|
I am looking for a way to format a hard drive from an application written in c#. Does anyone know how this is done?
Andres
|
|
|
|
|
You could use Process.Start() to excecute this command:
string formatCommand = "Command.com /C Format /Q /Autotest C:"
_________________________________
Please inform me about my English mistakes, as I'm still trying to learn your language!
|
|
|
|
|
|
not sure but on options of project there is an option to app for being fully trusted or u can check out deployment pattern on http://www.msdn.com patterns&practices section...
Mikail Çetinkaya . The C# DEveloper
|
|
|
|
|
HELLO EVERYBODY.
I'AM NEW WORKING WITH C# BUT I WANT MAKE A HTML EDITOR IN WINDOWS 32 FORMS LIKE 'DREAMWEAVER' OR SOMETHING ABOUT THAT.
SOMEONE KNOW ABOUT ONE OR MORE COM'S OBJECTS FOR DO IT THESE?
THANKS IN ADVANCED
SINCERELY ANTHONY ACUÑA
PREFERED PHRASE:
SOMEBODY TELL ME WHY IS MORE REAL WHEN I DREAM THAT I AM WAKE?
|
|
|
|
|