|
I'm trying to paint some extra info on to a rtb control and the only way to do so is by setting ControlStyles.UserPaint to true so the Paint method gets called, but slight problem since its all user drawn the text doesn't get drawn How do i get around this?
Thanks
|
|
|
|
|
You could call the base OnPaint method from your code.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
When i call the base.OnPaint method it throws an error, and when i single step through it once the base.OnPaint method is called it loops back to the begining of my Paint handler. Im guessing this is because ControlStyles.UserPaint is set to true but that is the only way the rich text box will allow any paint handlers to be called.
|
|
|
|
|
I would like to capture POST data from a local web form displayed in a .NET WebBrowser control.
In activeX browser you can use the "BeforeNavigate2 event" to capture POST data and the entire HTML header, but I only see the cancel flag and target frame name in the .NET 2.0 control.
Does anyone know how to capture this data in .NET?
|
|
|
|
|
HI,
Win32 Class Example : Win32_BIOS
is there any way to get the list of those classes
from the system (not manually)
Have Fun
Never forget it
|
|
|
|
|
Is this a C# class ? If so, you can use reflection. If not, then no.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
THANKS
Have Fun
Never forget it
|
|
|
|
|
That's a WMI class. You'd have to use WMI methods, and the .NET BCL System.Managment namespace classes to do this. I can't remember how, because I haven't done it in about 10 years, but it is possible to do. CIM_Studio does the exact same thing.
|
|
|
|
|
THANKS
Have Fun
Never forget it
|
|
|
|
|
We have several embedded resources file in XML format that can be loaded at runtime. The UI is a WPF application. When these files area loaded, it constructs objects via the XmlSerializer, and those resulting objects are used to make little boxes float around a 3D window for a simulation. At some point when adding, the application appears to hang. Alright... That's happened to me a-plenty, but it throws absolutely no exception and I don't get the "Not Responding" notification. Another interesting observation is that after the hang, when the mouse is put over the app window, the control boxes flash like a rapid hover-over. When I break into the debugger (btw I have the IDE to break on all thrown exceptions) I can see where the app stops, but no data is available because the IDE reports that the executing thread is in a sleep or join state.
I guess the question is how can I detect when the Dispatcher Thread takes a dirt nap? Is there a way to appoint a new thread to watch it and restart?
Scott
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
After dealing with this for two days, we found the issue. The coordinates for the floating boxes are calculated with respect to time in a wrapped timer. We changed the internal timer of that class to be a DispatchTimer and now everything seems fine... Thanks to those that took the time to read this.
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
Just out of curiosity.
how does WPF deal with gui elements and threads?
is it the same as winforms idea?
"only the main thread should interact with gui elements, other threads have to marshal calls to the main thread"
or can threads create / interact with wpf elements freely?
|
|
|
|
|
From what I've read, WPF assigns 2 threads at the start, a Render thread and a Dispatcher thread. The Render thread does the background work, while the Dispatcher thread does the work of maintain the GUI. Any explanation I give you won't be as good as this on MSDN[^]
Scott
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
Does anyone have experience using this? Just wanting to get an overall feel of how people feel about this before I jump in head first and end up regretting it. Any feedback would be greatly appreciated.
|
|
|
|
|
Object Relational Mapping [^]is rough so you probably will regret it but the other options are no better.
Also look at the Castle Project's[^] Active Record which uses NHibernate
Also if .NET 3.5 is in your future I see people here on CodeProject seem to like LINQ so you might check that out, there is a forum for it LINQ and .NET 3.5
led mike
|
|
|
|
|
NHibernate have a huge userbase and is a very competent mapper.
As a mapper it is _far_ supperior to LinqToSql.
However, the tool support and nice linq support in LinqToSql is way better.
(The NH team is working on their Linq support, so it will come eventually)
So if you want some RAD with a very basic DB, then go LinqToSql.
If you have a serious system with a complex db , then use NHibernate.
Also, the mindset of using an ORM is way different from "the other ways"
When using an ORM, your Domain Model is the core of your app.
The DB is pretty much just a persistent store for your objects to sleep in when not used.
(thus "Hibernate")
The whole idea is to be able to work with objects in an object oriented language.
Which probably was the main reason you started to use an object oriented language from the start.
It also tend to be a somewhat heated debate, some will claim that working with objects is madness and not very good at all when performing business operations etc.
(some might even pull data out of their db and transform it via some (mapping info/declaration) into a new (persistent) structure and apply dirty tracking and other infrastructural features on this structure and claim that they are NOT doing ORM and that ORM is bad )
modified on Wednesday, April 9, 2008 4:07 PM
|
|
|
|
|
NHibernate is an excellent library and is very robust and flexible. We use it as the core of our data layer toolkit for these reasons. It can be a bit intimidating for a new user though.
If you decide to go with vanilla NHibernate you should fix whether you are going with 1.x or 2.x - as the new 2.0 beta has introduced quite a few breaking changes to the API - especially with queries.
|
|
|
|
|
|
Hello,
I am working on a uninstaller program. Right I'm able to get all the info from the registry on all programs installed using a console application. What I need is a sample list control that will need about 14 columns and any number of row. This way I can display to info on a windows form so that way the user can remove his/her programs.
Just need a little help picking the right component to do this.
|
|
|
|
|
I think if you use a datagrid and a custom class, you can bind directly to a list of your custom classes.
Scott
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
I am having a webservice which creates an excel file in server and sends back it as byte array.
Now i want to write that byte arry in excel file in the client side.can any body help me out.It's an winform application.
|
|
|
|
|
kurangu wrote: i want to write that byte arry in excel file in the client side.
Well if those bytes represent the bytes of the Excel file then you just write them to a file. If they are something else then we don't know what they are so we can't help you.
led mike
|
|
|
|
|
Mike,
It's an bytes of excel file.But when I write in client side.Not able to open the excel file.It says not in recognizable format is there any format getting changed by webservice.
|
|
|
|
|
kurangu wrote: is there any format getting changed by webservice.
how could I possibly know what the webservice is doing?
led mike
|
|
|
|
|
string sfilename = @"C:\\\\test.xls";
FileStream fs = new FileStream(sfilename, FileMode.Create);
xlw.Save(wb, fs);
byte[] binFile = new byte[fs.Length];
fs.Read(binFile, 0, (int)fs.Length);
fs.Close();
return binfile.
Mike the above code returns the byte(right now I am saving the excel file with test.xls in server)
after that i am getting the byte.
client coe:-
-----
byte[]test=webservice.getdata();
FileStream output = new FileStream("C:\\test2.xls", FileMode.Create,FileAccess.Write);
output.Write(test, 0, test.Length);
output.Close();
Test 2 created with the same size as test in server but when i open I am geeting format not good.with empty xls.
|
|
|
|