|
Brute-force:
s = s.Substring ( 0 , 32 ) + s2 + s.Substring ( 32 + s2.Length ) ;
(Not tested)
|
|
|
|
|
It will replace the text that you specify at the position where that text is found. If you want to replace a piece of string based on location, instead of based on a keyword, use "Substring".
Doin' lots of replacements? Check out Regex
I are troll
|
|
|
|
|
Hi again friends
i have 3 diff forms.
1. BaseForm.( Includes 2 button, Buttons Text "Form1" and "Form2")
2. Form1. (Just inherited BaseForm)
3. Form2. (Just inherited BaseForm)
I know its easy.
I have tried a lot and google a lot but cant find...
Anyway I am asking for help here.
when I run program the base form will appears.If the Button Form1 clicked then
it shows form Form1 and disable Form1 button in that form.
and Hide BaseForm.
same action for Button Form1.
Can anyone show me some code or sample plz.
My other question is
When I click the Right Top Cross button then the Background BaseForm Still running. I want to close all form If I click the cross.
How Can it possible. Plz show mw the way.
Thanks Friends.
|
|
|
|
|
ok when you click button for form 1 or 2, hide the base form then show the desired form with the ShowDialog() method. after which you then show the baseForm again
Then for the disabled buttons you simply close the current form.
soulidentities wrote: I want to close all form If I click the cross
Handle the on close event for each form, then call Application.Exit();
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
Thanks friend for fast reply.
I take the method ShowDialog() from your advice but I cant take the "Simply Close the Current Form"
I need to disable the button. Its my real problem.
I mean when i click the button Form1, it will show Form1 form and hide base form(in the background baseform load newly as well because its being Inherited).
I tried to set click Event on the button in the BaseForm so that when it click it will show form and disable button. But since the BaseForm load freashly it cant not detect the click and the button visible.
Plz some one help me.
Thanks
|
|
|
|
|
ok you lost me now
let me get this straight -
BaseForm has 2 buttons called 'Form1' and 'Form2' only
Form1 has 1 button called 'disable'
Form2 has 1 button called 'disable'
Now...
when you click 'Form1' you want to hide baseForm and show Form1, right?
then when you click 'Disable' on Form1 you want to hide Form1 and then re-show BaseForm, right?
Same for Form2, right?
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
Im sorry i made u confused
You are almost clear with my probs just a lil misunderstood.
Im gonna clear it now.
Form1 has 1 button called 'btnForm1' and text 'Form1'
Form2 has 1 button called 'btnForm2' and text 'Form2'
now when I click 'Form1' I want to hide base form and show Form1
and
Disable the btnForm1 button. Means u cant click btnForm1.
U just can click Form2 button when form1 shows.
I think now I made u clear.
Thanks buddy
|
|
|
|
|
I haven't dealt with an inherited form but I think this achieves what you want - adapt to suit.
using System;
using System.Windows.Forms;
public partial class BaseForm : Form
{
public BaseForm()
{
InitializeComponent();
}
public BaseForm(bool showForm1Button)
: this()
{
btnForm1.Visible = showForm1Button;
}
private void btnForm1_Click(object sender, EventArgs e)
{
BaseForm newBaseForm = new BaseForm(false);
newBaseForm.FormClosing += new FormClosingEventHandler(newBaseForm_FormClosing);
newBaseForm.Show();
Hide();
}
void newBaseForm_FormClosing(object sender, FormClosingEventArgs e)
{
Close();
}
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Hi SoulIdentities,
I would use an Event Handler, that contains your own bespoke EventArgs. You can contain within that EventArgs a delegate that points to a function. Your base class will contain the function and you will register the event handler of your childs form to your base form.
When you close the child form, you will call the eventhandler, which will in turn post up to the base form which will react with a close of itself.
Cheers,
Paul
|
|
|
|
|
Sorry Paul
I am not clear.
Can you make some example.
I will appritiate it.
Thanks
|
|
|
|
|
Dear All,
I have a network application with UDP implementation.
In the server it has a specific IP and port number configured.
It will listen for the messages from the client to server and acknowledges the same.
Same way some times the server will initiate the communication and will try to send the message from the server to client.
For the messages from client to server and ACK it is working fine, even though the client or the server is restarted.
For the messages form the server to client, it tries and if the client is not reachable, it throws the error and then in the catch also I have made the server to continue to listen by calling BeginReceiveFrom, but it still throws the error.
The code used is:
private void OnReceive(IAsyncResult ar)
{
IPEndPoint ipeSender = new IPEndPoint(IPAddress.Any, 0);
EndPoint epSender = (EndPoint)ipeSender;
try
{
serverSocket.EndReceiveFrom(ar, ref epSender);
Data msgReceived = new Data(byteData);
ipeSender = epSender as IPEndPoint;
byte[] message = new byte[<<ACK size>>];
serverSocket.BeginSendTo(message, 0, message.Length, SocketFlags.None, epSender,
new AsyncCallback(OnSend), epSender);
byteData = new byte[40];
serverSocket.BeginReceiveFrom(byteData, 0, byteData.Length, SocketFlags.None, ref epServerSender,
new AsyncCallback(OnReceive), epServerSender);
}
catch (Exception ex)
{
byteData = new byte[40];
serverSocket.BeginReceiveFrom(byteData, 0, byteData.Length,
SocketFlags.None, ref epServerSender, new AsyncCallback(OnReceive), epServerSender);
}
}
}
Can any one help me to get rid of this issue.
Thanks a lot in advance.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
"Push" is evil.
A server should not send unrequested data.
But maybe someone can help you.
|
|
|
|
|
I am looking for some article talking about chm maker written in c#.
thanks.
|
|
|
|
|
Seraph_summer wrote: I am looking for some article talking about chm maker written in c#.
Are you?
It looks to me that your asking someone else to look for the article for you
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
no at all!
I just want to know if anyone has some information on it.
|
|
|
|
|
then you OP is just a general statement.
Sorry, i have no info for you, try Googling 'C# create chm file'
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
hi,
what IT developers need to monitor, control and trace processes and applications of their system?
In other word, what are the features of any PC monitoring applications?
|
|
|
|
|
Hey, welcome to codeproject. Check out the link in my signature to get base for how thinks run around here generally. Firstly, allow me to reiterate, try using useful thread topics, "4 IT developers" isn't very helpful. Also, the forums are meant for more specific problems, not vague general research topics, we are not google[^], google[^] is google.[^]
shefa' isied wrote: what IT developers need to monitor, control and trace processes and applications of their system?
In relation to C#, this is a very big question, but a quick push to a start would be the System.Diagnostics namespace[^].
shefa' isied wrote: In other word, what are the features of any PC monitoring applications?
Use google to help you find that out, you are able to do research.
|
|
|
|
|
Task Manager with Windows is sufficient in most cases. You will also find Spy or Spy++ installed with Visual Studio to be useful.
|
|
|
|
|
Darn, I was hoping this was a job ad and you needed four IT developers.
|
|
|
|
|
What you don't get enough poor treatment from Indians on Dice?
|
|
|
|
|
The local Indians don't need developers; they need people to plunk coins in slot machines.
On an unrelated note... You're an independant contractor, yes? You get 1099s and estimate your taxes? Do you have to contribute to unemployment and Social Security?
|
|
|
|
|
If you do 1099 you have something called SE Tax which will be 7.5% of your income after expenses. A large chunk. I have my own corporation so I only pay SS and Medicare on my W2 wages and not profit at the end of the year. With respect to Unemployment insurance most States do not require it if you own your own company and are the sole employee, 1099 does not require it period. If you wish to carry it then it is nearly a trivial amount. Also, 1 million in general liability will run about $250 a year if you want to carry it.
The bonus of having your own company is that it is perfectly legal to accept 1099 payment (some vendors refuse to do Corp-Corp and only do 1099) and then toss the 1099-Misc at the end of the year.
If you do 1099, my best advice is to take 25% of net (after expenses) and send it to the feds via estimated tax payments every quarter. You will get a little back but the next year but it is a surprisingly good assessment.
|
|
|
|
|
|
i want to perform analysis on SQL code.
In this i would like to separate the blocks in SQL code.
for example, in the code below
for condition1 loop
stmt1;
for condition2 loop
stmt2;
end loop;
end loop;
i want to separate these two blocks and create a data structure which will contain outer loop block and will also have inner loop block.
which is the best way to do so? is there any parser available which can handle the nested loops in the best possible way?
modified on Tuesday, February 24, 2009 7:45 AM
|
|
|
|