|
Hello,
How do I specify what DialogResult value my dialog box is supposed to return to the caller? This assumes the caller called ShowDialog() to show my dialog box.
Thank you
|
|
|
|
|
what about:
this.DialogResult = DialogResult.Cancel ?
hard, hey?!
|
|
|
|
|
Thanks, Mr. Lloyd! It's hard when you don't know it!
|
|
|
|
|
Glad you thank me! That's good behavior!
Certainly the experience help and being a beginner is always difficult.
That makes me think to an additional advice:
Download the documentation!
Then ... mhh ...
Open the index tab, in the "Look for:" text box type: "DialogResult"
You will see!
The documentation is a great source of knowledge!
Ans so is http://www.google.com/[^]
|
|
|
|
|
how can i connect to database by ip not server name
MD_NADA
|
|
|
|
|
By writing the ip number instead of the server name.
(Curious to why you didn't try that before posting a qustion...)
---
b { font-weight: normal; }
|
|
|
|
|
Hi
This is my first experiment with c#. I am making an application that must have two threads. One should handle the main dialog and it's message loop. I am starting the other thread in main method and this thread creates another independent dialog(which is an animated tasbar notification). But I should also be able to handle events(button clicks for example) in this second dialog. But my second thread is taking control immediately after showing the dialog and I cannot find a way to transfer control to the message loop of the second dialog. The following code snippet makes clear of what I am talking of.
<br />
public static void NotificationThreadProc()<br />
{<br />
Console.WriteLine("Inside notification thread");<br />
Notification n = new Notification();<br />
n.showNotification("Hello");<br />
<br />
Thread.Sleep(2000);<br />
n.hideNotification();<br />
n.Close();<br />
return;<br />
}<br />
NotificationThreadProc is the procedure name I passed as a parameter to ThreadStart(). Notification is my second dialog. Show notification simply runs a for loop resulting in animating the dialog to look like a taskbar notification. I need a button inside this notification and I need an event handler to be invoked when I press this button. But since the thread that created this control is busy sleeping. How can I make this Notification thread listen to events from inside the Notification dialog? Please help..Any small clue is highly appreciated.
Thanks in Advance,
venkat.
|
|
|
|
|
Hi
Im a beginner and need some help
How do i write to a text file that already has data in it. I basically want to insert the values i put in my textboxes as a new record in my txtfile. It must not create a new file or delete the existing records.
Also, i know i should put all the textbox values into an array, but how do i write this array seperated by commas to my txtfile?
ie. textfile looks like this:
John,15,motorbike,20,12
Luke,12,car,24,11
Please could someone help me out
|
|
|
|
|
Use the System.IO.File.AppendText method to open the file for appending.
You can use the string.Join method to join the values in an array into a single string.
---
b { font-weight: normal; }
|
|
|
|
|
Hello,
I want to change the BackColor property, for instance, of a control belonging to the main form from a seconday form.
How can I do that?
Please help. Thanks.
|
|
|
|
|
see the MVC Pattern[^]
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
Threre are two ways.
1. you could pass the mainform reference to secondary form in the secorndaryform's contructor and use reference to change backcolor property.
mainFrm.BackColor=value;
or
2. Create an event in the secondary form which the mainform should register. when ever you want to change mainform backcolor just trigger the event from secondary form. The mainform's event handler should do this.BackColor=value;
Hope this helps.
Thanks and Regards,
Srini
|
|
|
|
|
Can you please tell me how can I 'pass the mainform reference to secondary form in the secorndaryform's contructor'?
I mean what's the exact code I should to the secondary form contructor?
Thank you very much.
|
|
|
|
|
public class SecondaryForm <br />
{<br />
public MainForm mainFrmObj=null; <br />
public void SecondaryForm(MainForm mainFrm)
{<br />
mainFrmObj=mainFrm;<br />
mainFrm.BackColor=colorvalue;<br />
<br />
}
|
|
|
|
|
does the object locked get unlocked? Is there some "guidance" on that in MSDN or somewhere?
Marc
Pensieve
Some people believe what the bible says. Literally. At least [with Wikipedia] you have the chance to correct the wiki -- Jörgen Sigvardsson
-- modified at 13:25 Saturday 10th June, 2006
|
|
|
|
|
Marc Clifton wrote: does the object locked get unlocked?
I'm almost certain this is true, which is why using lock() is preferred over manually locking an object (and unlocking it in a finally clause).
[edit]
See this[^] MSDN article.
[/edit]
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
What is the format of the data you are trying to parse?
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
The format is yyyyMMdd
|
|
|
|
|
Are you sure that it's the parsing part of the code that is not working?
The expression in the Select call doen't really look like it should work. The value you are comparing the date field with is either a string or a date, but there are no apostrophes or # characters around the value.
---
b { font-weight: normal; }
|
|
|
|
|
Exaclty the way that you have done it. I tested it and it works perfectly.
Read my previus post again.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
Found the problem. I had white spaces like this:
<Date> 20060204 </Date>
Changed it to this:
<Date>20060204</Date>
Thanks for your help!
|
|
|
|
|
hello everybody in this forum.
first of all , i would like to thank every programmer that helped me in the last few problems i faced , Really i respect all of you in this great website for programmer to programmer experience sharing.
i face one problem in connection . every body knows that i can't connect to a user connected through DSL or broadband connection users cause their Private network is mapped by a NAT Router that Connects them to the outside world. That is fine
but i would like to connect to any user on the world wide web for these reasons i successfully programmed the following
-------------------
1)i succeeded to add my application to Windows Firewall programmatically to the exception list.
2)i added my application port that the messenger will listen on and receieve incoming packets from the outside world in SERVICES programmatically .
Services options are found in your current connection Settings under
Go to your control panel - > Network connections - >current connection -- > properties ->advanced -> Settings -> Advanced Tab -> Select your current connection -> and press settings - >this is where i added my application successfully once it runs programmatically through Hnetcfg.dll in system32 but the problem still exists
The problem is that my friends on DSL or broadband connection that have my application running , i can't connect to them directly even when i had their router ip address and my application also had successfully added itself in the above settings.
----------------------------------------------
I read in MSDN that there is NAT TRaversal . and they expose alot of interfaces like INATupnp , IStaticPortMappings and others interfaces which are existed in hnetcfg.dll but when i add that file to my application i don't find those interfaces.
Note:
------
i was on winxp sp1 and then installed winxp sp2 and also i didn't find those interfaces .
So any one can help me to make the router for Lan Users know how to deliver packets to their specified computers in Lan from the outside world ?
Please i want to reduce the traffic and bandwidth from the server itself by direct connection.
Human knowledge belongs to the world.
|
|
|
|
|
I have this method in a vb6 dll that i want to use from c# code
===================================================
Declare Function ProcessData Lib "xyz.dll" (ByVal sOut As String, ByVal nOutLen As Integer, ByVal sIn As String, nInLen As Integer, ByVal LowResolution As Integer) As Integer
===================================================
my import code is as following:
===================================================
[DllImport ("xyz.dll",
EntryPoint="ProcessData",
ExactSpelling=false,
SetLastError=true)]
[return:MarshalAs(UnmanagedType.I4)]
protected static extern Int32 ProcessData(
[MarshalAs(UnmanagedType.LPStr)] string sOut,
[MarshalAs(UnmanagedType.LPArray)] Int32[] nOutLen,
[MarshalAs(UnmanagedType.LPStr)] string sIn,
[MarshalAs(UnmanagedType.LPArray)] Int32[] nInLen,
[MarshalAs(UnmanagedType.LPArray)] Int32[] LowResolution);
===================================================
it is always returning unexpected results. I do not know what is the problem. could you plz help?
|
|
|
|
|
Hi guys!
I am a newbie to this language and I request your help. I have a text file called confirm.ini which I am trying to parse it and then load different data in the file into different text boxes.
Here is how my confirm.ini file looks like:
Directory Containing Source Files for Processing: C:\text\Users\
Directory to Archive Processed Files: C:\text\Archive\
----------------------------------------------------------
Configuration:
Users: WWWW
Accounts: 3fffffff
AR: 212222
AD: 232313
Participants:
Amount: 23
Fee: 4444444
-------------------------------------------------------------
Basically I need to load each fields above, i.e. Users value "WWWW" into Users.text and then Accounts value into Accounts.text and so on. Please help, I am kind of lost in this matter.
I appreciate your help in advance.
sasa
|
|
|
|
|
you can read ur file into a string variable ( ex: text) and use follow methods or properties:
<br />
string find;<br />
find=text.Substring(int_start_index,int_length);<br />
find=text.Replace(old_value,recently_value);<br />
and ....<br />
<br />
note : use using System.IO; for working with files.
|
|
|
|