|
sob sob... thanks for the assistance thus far. Guys, anyone else can help?
I saw an article that someone manage to solve it but the link is no longer valid.
http://nopaste.rautemarcel.de/[^]
|
|
|
|
|
Dear All,
I have a DataTable which has 8 records and it will have more records at later too.
the data table has two fields (columns) which is "Id" and "Name". I would like to create enum based on "Name" field and the value of enum based on "Id" field.
Is it possible to create enums at run time using c#.
|
|
|
|
|
Well how exactly are you hoping to use them?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
well i have checkboxes in many forms. when they are checked i want to insert the enum value in the child table.
i can assign the value without run time, but i am afraid if the table "id" is changed than i am stack, so i am creating enums at run time.
|
|
|
|
|
sorry you are going to have to try to explain that again.
why dont you give an example of a few check boxes and the values you would like to insert into your table when they are checked/unchecked
Member 6059028 wrote: i am afraid if the table "id" is changed than i am stack
Do you mean the column name of the table or do you mean the actually id value for the table entry?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
You can't.
The enum has to be created before hand, but you can save the values to the database and parse them at run time by using Enum.Parse(). Please note that you ought to use "Enum" and not "enum", the first is a type the second is a keyword
If the post was helpful, please vote!
Why won't the worm just leave me be?
|
|
|
|
|
I have gone to create enum at run time using System.Reflection.Emit.EnumBuilder.
i can create enums at run time using mentioned class.
and hopefully it can be destroyed when you close the application.
|
|
|
|
|
Reflection is another matter. How are you expecting to be able to utilize it then?
If the post was helpful, please vote!
Why won't the worm just leave me be?
|
|
|
|
|
You can, but I don't see a reason to.
I'd suggest using a Dictionary or something.
Or this[^].
|
|
|
|
|
I want to paint a selection image on top of the existing image of a PictureBox (just changing the BorderStyle looks ugly if you select more than one).
So far I have this:
g = Graphics.FromImage(((PictureBox)sender).Image);
g.DrawImageUnscaled(new Bitmap(filepath), 0, 0); where g is a Graphics object and filepath is the absolute path of the selection image.
Is there a way to use a relative path, I tried just using the filename and "Images\Selection\Selection Image" but these wouldn't work.
Anyway, how do I make the PictureBox re-pait itself the moment you select it?
I tried adding something like this
this.InvokePaint(((PictureBox)sender),new PaintEventArgs(this.CreateGraphics(), ((PictureBox)sender).ClientRectangle)); but it didn't make a difference, with or without the PictureBox only gets re-painted when the whole form gets re-painting, but not immediately.
Thanks.
|
|
|
|
|
Call it's Invalidate method
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Hmmm if i understand you correctly then try...
PictrueBox1.Invalidate();
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Thanks, this works.
I wonder why I didn't think of this...
|
|
|
|
|
Hi,
In the custom control Paint event i want to save all activities in every Paint event firing. So when i draw anything in that custom control i can record, so i can play the recorded file later.
How can i record the paint event in the custom control?
Thankyou
YPKI
|
|
|
|
|
|
Do you need the actual steps, or just the result?
You could get a bmp grab of the control at the end of your Paint event easily enough.
|
|
|
|
|
i want to save each event to a file and need to play those events when ever i requried.
|
|
|
|
|
Dear sir,
i have two list view, i want to drag one item from one list view to another list view. how can i do this??
yogesh
|
|
|
|
|
There's an excellent article on CodeProject describing how you build that kind of functionality.
Good luck
I are troll
|
|
|
|
|
plz give me that link sir,
yogesh
|
|
|
|
|
|
You only posted this problem 3 hours ago. Please don't attempt to bump your post to the top - be patient. Bumping posts is considered to be bad forum etiquette and is likely to end up in you being ignored.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Give in an hour then post again... third time lucky as they say...
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
how to use C# draw two curve(noCloseCurve) on window.
|
|
|
|
|
Look at the members of the Graphics class, i think DrawArc() is what you will want.
Then handle or override the OnPaint event for the control you want to draw on. That will expose a Graphics instane within the event args that you can draw to. Remember that OnPaint is called when the control needs repainting so you may want to use the Invalidate() method of the control to force a redraw as and when you need to
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|