|
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
|
|
|
|
|
If you close the Stream you got the image from before saving, you tend to get this error. Keep the "opening" stream open till after you saved it.
|
|
|
|
|
hi
i am facing a problem in communicating web services through desktop client.
my pc is behind the firewall. when i am testing the application through the .net iDE its working fine.its communicating properly. when i am installing the client through setup its giving the error
error : ---- start
The underlying connection was closed: An unexpected error occurred on a receive.
at System.Web.Services.Protocols.WebClientAsyncResult.WaitForResponse()
at System.Web.Services.Protocols.WebClientProtocol.EndSend(IAsyncResult asyncResult, Object& internalAsyncState, Stream& responseStream)
at System.Web.Services.Protocols.SoapHttpClientProtocol.EndInvoke(IAsyncResult asyncResult)
at WebServicesTestingClient.com.sterlinginet.dev.UASPDetails.EndUASPDetailsSet(IAsyncResult asyncResult) in E:\GamaProjects\WebServiceProxyTestingClient\Web References\com.sterlinginet.dev\Reference.cs:line 49
at WebServicesTestingClient.Form1.button1_Click() in e:\gamaprojects\webserviceproxytestingclient\form1.cs:line 211
error end
my code is looks like
private void button1_Click()
{
try
{
setProxy();
richTextBox1.Text = "";
richTextBox1.AppendText("initializing the web services\n");
com.sterlinginet.dev.UASPDetails service = new com.sterlinginet.dev.UASPDetails();
// Firewall/Proxy Setting (use this settings if you are accessing behind a firewall).
WebProxy oProxy = new WebProxy(addressTxt.Text, Convert.ToInt32(portTxt.Text));
///oProxy.Credentials = new NetworkCredential();
service.Proxy = oProxy;
service.Url = "http://dev.sterlinginet.com/Makhaas/Gama/UASP.asmx";
richTextBox1.AppendText("web services initialized successfully\n");
DataSet dataSet = new DataSet();
DataTable dataTable = new DataTable();
dataTable.Columns.Add(new DataColumn("UA_ID",System.Type.GetType("System.Int16")));
dataTable.Columns.Add(new DataColumn("UA_CODE",System.Type.GetType("System.Int16")));
dataTable.Columns.Add(new DataColumn("UA_NAME_LA",System.Type.GetType("System.String")));
dataTable.Columns.Add(new DataColumn("UA_NAME_AR",System.Type.GetType("System.String")));
dataTable.Columns.Add(new DataColumn("UA_MOH_STATUS",System.Type.GetType("System.Int16")));
dataTable.Columns.Add(new DataColumn("UA_MOH_TIMESTAMP",System.Type.GetType("System.String")));
DataRow row = dataTable.NewRow();
row[0]=101;
row[1]=5001;
row[2]="Testing LA";
row[3]="Testing AR";
row[4]=1;
row[5]="2006/02/26 11:33";
dataTable.Rows.Add(row);
dataSet.Tables.Add(dataTable);
richTextBox1.AppendText("wait working on web services\n");
System.IAsyncResult rs = service.BeginUASPDetailsSet(dataSet,null,null);
service.EndUASPDetailsSet(rs);
if(rs.IsCompleted)
{
richTextBox1.AppendText("success\n");
}
else
{
richTextBox1.AppendText("failure\n");
}
}
catch(Exception ex)
{
richTextBox1.AppendText(ex.Message+"\n\n"+ex.StackTrace+"\n\n");
}
richTextBox1.AppendText("finished");
}
private void setProxy()
{
try
{
int port = Convert.ToInt32(portTxt.Text);
WebProxy proxyObject = new WebProxy(addressTxt.Text, port);
GlobalProxySelection.Select = proxyObject;
}
catch(Exception e)
{
MessageBox.Show(e.Message+"\n\n"+e.StackTrace);
}
}
please try to solve my problem
guys i am eagerly waiting your response
Mohammed Meraj
Project Leader (IT)
GAMA
Jeddah
KSA
mohd
-- modified at 6:57 Monday 6th March, 2006
|
|
|
|
|
Hi,
I have to right-click a set of nodes(respectively) and some options should be displayed there...If i click the menu ,according actions should be done....
Similar to a normal mouse Right-Click option..
Kindly help me in implementing this code..
Thanx
|
|
|
|
|
- Add a context menu to your form (contextMenu1)
- Use the designer to set it up
- Add event handlers to it
- Set the ContextMenu property of your tree control to contextMenu1
- Dy
|
|
|
|
|
Thanx for ur quick reply friend...
Could you suggest me any samples in any sites...'coz i have no idea over it.....
|
|
|
|