|
The value returned from GetSection() will be the object (if any) returned from your IConfigurationSectionHandler.Create() implementation.
Put a breakpoint in your...
FeedLib.SsnConfigurationHandler.Create()
...method - it should get hit and you can see any issues in there.
|
|
|
|
|
Hi guys,
I've got a form that has a number of textboxes. When a button is clicked I want the data in the boxes to be sent to the class that opened the form. How do I go about doing this?
In myClass I call the form using
<br />
myForm.Show ();<br />
This opens the form but how then do I get the data from it? It seems to want an instance of the calling class in the myForm, but I can't do this.
Hope that makes sense.
|
|
|
|
|
You could expose some properties that the calling class will get when the form is closed. This may be done in numerous ways, one would be to catch the Form.Closed event (the calling class catches the one raised by the called form).
private void OnMyFormClosed(object sender, EventArgs cea)
{
MyForm myForm = (MyForm)sender;
string textBox1content = myForm.TextBox1Content;
}
------------------
As I suggested, there are numerous other ways, like opening the form in modal mode and just wait for the ShowDialog() method to return, but still using properties. Also, you could use a custom event with a EventArgs-derived class containing the data of interest.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
-- modified at 12:40 Tuesday 28th February, 2006
|
|
|
|
|
I've used the ShowDialog method with properties and it works fine.
Knew it would be fairly straight forward - just not for me.
|
|
|
|
|
:->
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Could you expound on your explaination a little.
Is the OnMyFormClosed() function located in the parent form?
How do you set an event to trigger when the child closes?
Thanks
Lyle
|
|
|
|
|
Lyle M wrote: Is the OnMyFormClosed() function located in the parent form?
Yes
Lyle M wrote: How do you set an event to trigger when the child closes?
The event is automatically triggered when MyForm closes. To subscribe to it, the parent form needs to do the following, before calling Form.Show().
myForm.Closed += new EventHandler(this.OnMyFormClosed);
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
If you want to send some data to another object - you have to have reference to this object. In your case this means that your myForm should have reference to base form. something like this:
call the form using myForm.Show(this) or set myForm.Owner = this just befor calling.
Then, on button clicks, you could do something like this:
((OwnerForm)Owner).OkButtonIsClicked();
You could get values of textboxes of myForm if their modifiers are internal or public, but
yYou could do it only if OwnerForm has reference to myForm, if not - you can invoke not OkButonIsClicked(), but OkButtonIsClicked(textBox1.Text, textBox2.Text, etc);
____________________________________________
Robin Panther http://www.robinland.com
|
|
|
|
|
I would not recommend this approach. This design is known as "tight coupling" or "re-coupling", and is an anti-pattern[^].
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
I need to display fraction like
1/2 or 4/5 etc on a windows form label.
I do not want to put Image. Is there a way
I can do this.
|
|
|
|
|
|
Many fonts will have unicode characters for fractions. If you open up \windows\charmap.exe, you can view these characters and find the character codes for them. For example, the Tahoma font has the following fractions: ¼ ½ ¾.
However, if you need arbitrary fractions, you might as well just draw the numbers to a bitmap and draw the bitmap, or optionally, throw together your own custom label or textbox that supports arbitrary fractions.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Connor's Christmas Spectacular!
Judah Himango
|
|
|
|
|
Judah Himango wrote: Many fonts will have unicode characters for fractions. If you open up \windows\charmap.exe, you can view these characters and find the character codes for them. For example, the Tahoma font has the following fractions: ¼ ½ ¾.
However, if you need arbitrary fractions, you might as well just draw the numbers to a bitmap and draw the bitmap, or optionally, throw together your own custom label or textbox that supports arbitrary fractions.
Thank you.
Do you have any example of this custom label and textbox ?
|
|
|
|
|
No, I don't. You need to inherit a control from label or textbox and draw from there. Label would be the easiest. Search this site for "custom control" if you need help doing this.
|
|
|
|
|
Hello, I have a windows form, and I want that all of my forms will have the same object as my first form had, this object is a Menu object.
how can I do this in the best way?
|
|
|
|
|
Make a form with that menu and then every other form will inherit that form.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
hello genius programmers!,
does Read, write and delete from registry with C# works only in an Administrator account or even in guest accounts??
if it does works on guest accounts can somewone help me....
thanks..
Im am SUPER P
|
|
|
|
|
|
thank you!!
Im am SUPER P
|
|
|
|
|
hi friends
i need some help regarding next few line of code.
fillcombo is my method which i want to use to populate many dropdownlist,i am passing id of dropdown box & query to method & calling method in page load.
there is no problem with query, but method is not getting id of dropdown list,it is just receiving system.Web.UI.WebControls.DropDownList
Thnx $ regards
Kamlakar
public void fillcombo ( system.Web.UI.WebControls.DropDownList cntrl,string query)
{
DataSet ds;
SqlDataAdapter da = new SqlDataAdapter(query,con);
ds = new DataSet("ref_codes");
da.Fill(ds);
Response.Write (cntrl);
cntrl.DataSource = ds.Tables[0].DefaultView;
cntrl.DataTextField = "RV_MEANING";
cntrl.DataValueField = "RV_DOMAIN";
cntrl.DataBind();
}
-- modified at 10:59 Tuesday 28th February, 2006
|
|
|
|
|
Hi,
Am new to C# ASP.NET
Back in the VC ages, we as programmers loved using GetPrivateProfileString() API to read from .INI files.
Is there any such API or for that matter any way that I can use the Win32 API in C#.NET environment?
|
|
|
|
|
|
hai iam trying to get the image from digital camera and to store, but its giving , out of memory error.pls give me code to rectify this error.how to convert bitmap to binary format , or formatting image.
|
|
|
|
|
How is anyone supposed to help you with a description like this?
You have to be a lot more precise if you want help...
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
leelaraj wrote: but its giving , out of memory error.pls give me code to rectify this error.
Get more memory.
Cheers,
Vikram.
I don't know and you don't either.
Militant Agnostic
|
|
|
|