|
HalliHaida wrote: doing i.e. he is activating the rcvr form by clicking a button on the sender form. So in this the focus shift happens with user notice right?
You stated that the form is shown on an external event; that means the app isn't active and won't get focus. If the user has clicked a form within your app, that the app has focus, and can move it around in it's own forms.
In short, the button would receive focus, execute the command, it'd open a new form (with focus again) and show it. But that is based on the other form having focus that the button is positioned on.
I are Troll
|
|
|
|
|
Yes, as you have mentioned the receiver form is shown on receiving the external event i.e through TCP listner. This external event is sent by the sender form when the "Activate Rcvr Form" button on it is clicked by the user. In the click event handler an event is sent to the receiver form.
These sender and receiver forms are running as separate apps.
Why I want this functionality is, in my final application I will be receiveing the mouse click event through a call back which will be sent by a dll. On receiving the call back, I have to activate the form so that user can type some text in the text box field.
|
|
|
|
|
HalliHaida wrote: I have to activate the form so that user can type some text in the text box field.
I tried to explain that you shouldn't steal the focus. It seems that failed, since you're still requesting this functionality.
An example on activating an app can be found on PIEBALD's[^] profile.
Good luck
|
|
|
|
|
hi
i have this code:
var lines = File.ReadAllLines(@"d:\text.txt", Encoding.Default);<br />
<br />
var questions = new Dictionary<int, string>();<br />
<br />
foreach (var line in lines)<br />
<br />
{<br />
<br />
var parts = line.Split(new[] { ". " }, StringSplitOptions.RemoveEmptyEntries);<br />
<br />
var number = Int32.Parse(parts[0]);<br />
<br />
questions.Add(number, parts[1]);<br />
<br />
}
i need it in class and that all my forms will
recognize the var questions
how to do it ? can i get any sample code ?
thanks in advance
|
|
|
|
|
You already have sample code. What I suggest you need to do is create a static class that wraps this code and store the results of the file read in a member.
|
|
|
|
|
This question was already answered in the Q&A section. I just went back there to find that it has been deleted. I don't know if it was you who posed that question, got it answered and decided to delete it. You can start by wrapping this code into a small console app yourself and come back when you run into problems with that task.
Best of luck!
|
|
|
|
|
Go ahead an try then. If you have issues, be more specific about what they are.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
You have been around for a year now; you should know code snippets look best inside PRE tags.
And BTW, you are abusing the var keyword.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Make this class static or else have a look at the singleton design pattern.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
It seems to me, you don´t know what a 'class' is.
No problem.
Solution: Start with reading a good book about 'C#', and/or a book about the '.NET Framework'. There is also enough material on the net, if you use this very unknown thing called 'google'.
Then you can either solve this simple coding problem by your own, or maybe you will run into other troubles. Then you can ask again.
I cannot remember: What did I before google?
|
|
|
|
|
Hi
i have a several problems with hosting designer within my app.
i've found some useful articles such as this[^] and this[^], but my problem does not solved and this codes is very complex.
can anybody help me give me a site, blog or someone which have an experience in hosting designer topics ?
thanks in advance
|
|
|
|
|
As I pointed out to you before, hosting a designer is a complex task.
Perhaps if you were to edit your post to explain what it is that you are trying to do. i.e. what it is that you are trying to design that needs a designer.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
|
|
|
|
|
Hi
i'm looking for someone or blog which have experience to this topic.
|
|
|
|
|
Yes, but if we don't know what it is that you are trying to do it is very difficult to make suitable recommendations.
While you are waiting take a look at the links at the bottom of Designing Nested Controls[^], many of them are related to design topics. Maybe you will find something there to help.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
|
|
|
|
|
Many thanks henry
i foud a good and simple resource in your link :
Hosting Windows Forms Designers[^]
it's very helpful for me, but my main problem is that i can save my designed form to xml file, but i can not load into my host designer and can not find any class to implement this functionality for me.
i'm looking for loading/saving host designed form at runTime.
|
|
|
|
|
Once again, it is difficult to advise you as I don't know how you have saved your Form but have you looked at the XMLSerializer class[^]?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
|
|
|
|
|
I want to remove , and . From string value but i don't know how to do that. I h've such type of string value string
str ="abc, d.e f,g h,i. J,k" plz help me
|
|
|
|
|
You can Replace them with empty strings.
|
|
|
|
|
you can simply remove , and . from your string value by using Split function.
take a look how to display
string str = "abc, d.e f,g h,i. j,k";
string[] arr = str.Split(',', '.');
foreach (string str1 in arr)
{
Console.Write(str1);
}
modified on Monday, January 24, 2011 1:04 AM
|
|
|
|
|
That doesn't remove them, it just shows them.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
|
|
|
|
|
Henry Minute wrote: That doesn't remove them, it just shows them.
check my code again I have programmed it and then compile and after compilation it gives me output like "abc de fg hi jk".
now what will you say it is removing or showing
|
|
|
|
|
It has not removed them from the original string, they are still there.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
|
|
|
|
|
If it works for me as well as OP then how it isn't work for you. i have again try and it gives me same output
modified on Sunday, January 23, 2011 10:54 PM
|
|
|
|
|
One addition to your code
string str = "abc, d.e f,g h,i. j,k";
string[] arr = str.Split(',', '.');
foreach (string str1 in arr)
{
Console.Write(str1);
}
Console.Write(str);
What do you get when you run that?
The commas and stops are still there. So, once again I say, your code does not remove those characters as the OP asked.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
|
|
|
|
|
Henry Minute wrote: What do you get when you run that?
yes If I will use your program it will give me Original string but I did programming for removing character and then display it.
as i getting OP also what this that's why he greet me for my answer.
you are right in your point of view
|
|
|
|