|
No, you have drawn something on the screen where the tabpage happens to be. Whatever you do to the tabpage won't affect what you drew. Actually, anything that makes the tabpage redraw will draw over what you drew.
If you want to draw something on the control, you have to use it's Paint event, so that whatever you draw will be redrawn when the control is redrawn.
---
b { font-weight: normal; }
|
|
|
|
|
How do I use paint event? When will the paint event be triggered?
I need to write different text on a tabpage line by line. Can the paint event draw different strings to a control?
Please help!!! I need a solution to it.
|
|
|
|
|
Does anyone Know where I can find a list of Messages that I can use with SendMessage function?!
Thanks
|
|
|
|
|
http://www.autohotkey.com/docs/misc/SendMessageList.htm
|
|
|
|
|
Thanks a lot, stan!!!!!
|
|
|
|
|
OMG! there´s even a tutorial for PostMessage!
Thanks a lot!!!!!!!!!!!
now my day is complete =DDD
Best Regards
|
|
|
|
|
Hi there!
I am having trouble with Serializing my classes into an XML file.
My classes are as follows:
**************
public class Class1 : CollectionBase
{
public Class1()
{
Class2 newClass = new Class2();
this.List.Add(newClass);
}
public Class2 this[int i]
{
get{return (Class2)List[i];}
}
public void Add(Class2 C)
{
this.List.Add(C);
}
}
public class Class2 : CollectionBase
{
public Class2()
{
this.List.Add("Hello");
}
public string this[int i]
{
get{return (string)this.List[i];}
}
public void Add(string S)
{
this.List.Add(S);
}
}
**************
Now they do serialize, however they do not serialize as I need them. The result looks like [I removed the namespace bits...]>
<?xml version="1.0" encoding="utf-16"?>
<ArrayOfArrayOfString ... >
<ArrayOfString>
<string>Hello</string>
</ArrayOfString>
</ArrayOfArrayOfString>
I need the names to be more user friendly instead of ArrayOfArrayOf... etc. A further issue I have is that my actual application consists of >
Class1 : CollectionBase
contains Elements of Class2
Class2 : CollectionBase
contains Elements of Class3
Class3 : CollectionBase
contains Elements of Class4
Class4
I want the serialization to NOT include the Class4 elements of Class3 however it does and I can't find a way to stop it?!
Does anyone have any ideas on how to correct this?
Many thanks,
Tom.
-- modified at 10:58 Wednesday 31st May, 2006
|
|
|
|
|
Use the XmlArrayAttribute and XmlArrayItemAttribute .
|
|
|
|
|
And use XmlIgnoreAttribute for the items you don't want it to serialize.
|
|
|
|
|
Thank you for the reply, Dustin!
I have tried to do this with no success.. If the classes contained a collection such as an ArrayList, this does work but as the classes are derived from CollectionBase, I cannot find a way to achieve the same results.
For the Class1/Class2 example I gave, where would I put the XmlArray attributes? Could you supply some code as an example?
Thanks,
Tom.
|
|
|
|
|
Ah, ok. I see what you're doing. Well, there's not really a quick and easy way to fix this. The XmlSerializer really is not that intelligent. One thing that I do is implement the IXmlSerializable interface whenever the XmlSerializer can't do the job. Is this an option for you? The alternative is to structure your classes in such a way as to be more conducive to the XmlSerializer.
|
|
|
|
|
Hi Dustin, thanks again for the reply!
I realised that by using the XmlSerializer, I would have to 'compromise' a little on the class structure design and I have tried to do this as much as possible but I unfortunately have gone as far as I can.
I should be able to implement the IXmlSerializable interface although I must confess, I've not done this before. I'll do some research now and see if this will help me out!
Many thanks for your help!
Tom.
|
|
|
|
|
The XMLSerialiser can only handle Arraylist or arrays. It says that in the docs somewhere.
|
|
|
|
|
Hi leppie,
Thanks for the reply.. That makes sense and fits in with what I have seen. Thanks for confirming!
Tom.
|
|
|
|
|
There are easy ways around any problems with types just using properties to get/set underlying non serializable types with TypeConverters.
|
|
|
|
|
Hi leppie,
Could you possibly detail an example using the original class structure examples I gave?
It would be much appreciated.
Thanks,
Tom.
|
|
|
|
|
It depends how you want the XML to look, show me what you want. And what will be the container of the 'outer' collection?
|
|
|
|
|
FunkyBeerMonster wrote: Class1 : CollectionBase
contains Elements of Class2
Class2 : CollectionBase
contains Elements of Class3
Class3 : CollectionBase
contains Elements of Class4
Class4
Isnt that just: Class4[][][] ?
|
|
|
|
|
Hi Leppie/Darren,
I think I have got this sorted now.. I have utilised the IXmlSerializer interface and with a small amount of tweeking, it seems to be sorted.
Thanks for your help!
Tom.
|
|
|
|
|
hi all,
how do i get a value in datagridview ?
cellValue = dataGridView1.Rows[0].Cells[1].ToString(); ??? how do i change this line ?
help please ...
thanks, bye.
|
|
|
|
|
If DataGridView works similar to DataGrid, then you
can use myDGView[row, col].ToString().
-Larantz-
|
|
|
|
|
I am new in C#.In doing a windows application
my form1 class has a Fee class that uses static methods,
i would like to use new_method in form1 class in the Fee class
i know i cant access methods in form1 class
,is there a way i can access form1's new_method without creating form1 object in Fee class?
public partial class Form1 : Form
{
public delegate void new_foo_delegate();
private MyUserControl mycontrol;
public class Fee
{
public Fee()
{
}
private void button1_Click(object sender, EventArgs e)
{
Thread t = new Thread(new ThreadStart(Run));
t.Start();
}
public static void Run()
{
invoke(new new_foo_delegate(new_method));//NB the method in my main
}
}
public Form1()
{
InitializeComponent();
}
public void method()
{
mycontrol.Dipslay(txtbox);
}
void new_method()
{
textBox1.Text = "Hullo";
}
}
}
nb this is just an example
hope my question is very clear
thanks
regards paula
|
|
|
|
|
PaulaM wrote: is there a way i can access form1's new_method without creating form1 object in Fee class?
Sure, as long as an instance of Form1 exists, you can expose that instance to the Fee object (that would be a broken design) any way you like and then call it's new_method() member. You cannot call new_method() without an instance of Form1.
|
|
|
|
|
If you are calling a non-static method then you need an instance of the class that contains the method. What exactly are you trying to do? Perhaps there is a better way?
One thing you might think about is could you have a static member in your fee class of type form1? That way you'd only have to create an instance of form1 once in your fee class.
|
|
|
|
|
i am using DSOFramer ocx control and i am getting error!
"Catastrophic failure"
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Catastrophic failure
Source Error:
Line 74:
Line 75: axFramerControl1.Titlebar = false;
Line 76: axFramerControl1.CreateNew("Word.Document");
Line 77: //axFramerControl1.Open(("http://localhost//Sample1.doc");E:\TEST Doc
Line 78:
pls do help me out!
Thanks in Advance!!
|
|
|
|