|
childForm.MdiParent = null;
I believe that's how I did it. I wanted some child windows to detach in order to drag them across both of my monitors. Then you can change to maximized and and whatever else.
|
|
|
|
|
well as u ask ....how to make full screen the child form of mdi....
so just do one thing.
1 ---go to the child form property and set the property "FormBorderStyle" to "FixedSingle" and set the "size" also to 935, 680 n above.
2-Now make the form child by command like
form1 _a=new form1();//Child Form
_a.MDIParent=this
_a.Show();
Niyamat Khan
9810320282
niyamat@iamsingle.in
|
|
|
|
|
Hi,
I have created a simple browser..my requirement is if i open my browser....all other opened browsers example IE,FireFox...need to get close....and should not re-open. I have tryed by killing the process...it worked out but its working only in the first time, by refreshing continuously i can achieve this....but how to auto-refesh a control or a page continuously
krishna
|
|
|
|
|
You can use timer control. And on tick event of timer that is
fired on specific time interval you have set, you need to perform
the action required to kill browser process and refresh your
browser control.
Find example of timer control here[^].
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Thanks alot...i have done it... :->
krishna
|
|
|
|
|
Hi, Everyone!!
I need ur help, regarding html entity replacement----
I have characters incoming from an xml template for example:
& —
I want to replace these in html code in c# like:
& — respectively.
can some one please help me with proper code.
because I am fresher.
waiting for your earliest reply.
thanx in advance
-- Modified Thursday, July 22, 2010 6:37 AM
|
|
|
|
|
Hi Ahamed, Please refer [HERE]
|
|
|
|
|
thanx for ur kind attention. i am seeing th link.
actually, in my xml file has & and mdash;
and i write in this character code in html , an want to show the above code is in character like: & and -
is there any namespace , to read entity
thanx
|
|
|
|
|
For complete list of Character Entities of HTML for
all numeric code refer this[^] link.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
hi..
I want help for how can solve these scenario . In my chat application , i was creates socket communication ( TCP /IP) . Once if we run the application to the system which is listen one port and send a data to another port .
With in a local area network , what are the application are , username appear all application . if we need to send to particular user . that will send to that ipaddress and corresponding that listening port ( Now already fixed listening and sending port address ). Now my question is if that port is used already with some another application , we can modify the listening port using application config file.
In the scenario how can fine the listening port or want to do something else please help me
Thanks
|
|
|
|
|
Typically a server represents a significant dedicated resource and one that will not often change.
Consequently the port will be free.
However one might still one to provide a way to configure it. In that case one needs to provide a way to configure the client as well to use a different port. This is a common idiom such that it can be seen in many places such as that http defaults to port 80 but there is a way to specify a different port. Same thing is true for databased connection urls.
There are other alternatives involving various ways of 'discovering' a resource which involve using another server (such as LDAP) or using a broadcast via UDP. Neither is likely to be suitable for a chat application.
|
|
|
|
|
Is this a client-server chat application or some kind of peer-to-peer chat application? Once a client connects to a server the server just needs to know what user is associated with that stream. You shouldn't have to keep opening and closing the connection.
|
|
|
|
|
Thanks for reply
This is not server client application . directly connect to application via IP/port ( peer to peer ).
If i check all consequently free port ( backward / forward ) , its occur any performance issue or may be time delay or have any network traffic . Its a major problem or simple one..
Thanks
|
|
|
|
|
I have a small program that loads the html code from a local html file. How can I extract the bold and italic text and display it?
I work with Visual Studio 2008.
Could you please direct me to some articles/code? I've searched and tried for one week now and can't seem to do it... I need this from school.
THANKS a lot. I really appreciate it.
Cris
|
|
|
|
|
you could use Regex class (multi-line, case-insensitive, ignoring space) to locate strings delimited by b, i, strong tags. You may get some trouble when some string is both italic and bold at the same time.
|
|
|
|
|
|
Sticking the file in a WebBrowser object won't do what you want?
More detail might be helpful.
|
|
|
|
|
Thanks for the reply! Unfortunately, I'm not allowed to use that. The professor said that I need to write my own code that will parse bold and italic tags and print them accordingly.
|
|
|
|
|
This[^] article may help.
/ravi
|
|
|
|
|
justme89 wrote: The professor said that I need to write my own code that will parse bold and italic tags and print them accordingly.
It depends on what you are supposed to be learning.
If you are learning regex then using that would be the way to go.
If you are learning parsing then you need to build a parser.
If you are learning GUIs then it probably doesn't matter how you parse it.
If you were writing a real application then the real choice is to find a html parser and use it. Or build one if there is some reason you can't find one.
|
|
|
|
|
MMM, as most homework assignments, the mission is a little vague, but here are a few ideas:
1. Make a list of all the tags indicating bold and italic, including a list of corresponding end tags
2
a. either use regex,
b. or StringBuilder class to extract the information from the html file,
c. but why not give a thought as interpreting the html as XML?
if the assignment is only to show the text with an indication for bold and italic, give a thought about removing all the other stuff in a first parsing run (tables, a tags, etc...) and keep the text with the bold/italic tags.
just quick ideas, best of luck.
V.
|
|
|
|
|
V. wrote: why not give a thought as interpreting the html as XML?
because in the majority of web pages the HTML is malformed and not valid XML, e.g. missing a lot of closing tags.
|
|
|
|
|
good point, although it shouldn't, it often is (malformed).
V.
|
|
|
|
|
I have been having some difficulty in a C# application that uses a UDP socket connection. Everything works all sorts of fancy and fun until the closing of my Form application, and then I can't seem to stop receiving messages.
I always get some form of exception inside of the receive callback stating that the socket is disposed. This is, of course, true. The problem is, why am I getting a message after I have closed down and shutdown the sockets? I'm not too familiar with every in and out of C# (don't think I'll ever get used to managed code. Can I have C back?) Included, I have the receive callback, which parses a message and continues to listen. I also included the CloseConnections method, which is called within the Form Closing event.
Does Shutdown and Close not stop the messages from being received? If so, how can I so that the GC may dispose of my sockets without receiving a message afterwards?
"An unhandled exception of type 'System.ObjectDisposedException' occurred in system.dll
Additional information: Cannot access a disposed object named "System.Net.Sockets.Socket"."
private static void ReceiveCallback(IAsyncResult ar)
{
StateObject stateObject = (StateObject)ar.AsyncState;
if(stateObject != null && stateObject.Socket != null && stateObject.DataBuffer != null && stateObject.EventMap != null)
{
int bytesReceived = stateObject.Socket.EndReceive(ar);
if(bytesReceived > 0)
{
SocketConnection.ParseReceiveBuffer(stateObject);
}
}
if(stateObject != null && stateObject.Socket != null && stateObject.DataBuffer != null && stateObject.EventMap != null)
{
stateObject.Socket.BeginReceive(stateObject.DataBuffer, 0, stateObject.BufferSize, 0, new AsyncCallback(ReceiveCallback), stateObject);
}
}
public void CloseConnections()
{
if(_recvSocket != null)
{
_recvSocket.Shutdown(SocketShutdown.Both);
_recvSocket.Close();
_recvSocket = null;
_recvState.Socket = null;
_recvState = null;
}
if(_sendSocket != null)
{
_sendSocket.Shutdown(SocketShutdown.Both);
_sendSocket.Close();
_sendSocket = null;
_sendState.Socket = null;
_sendState = null;
}
}
|
|
|
|
|
When you close a Socket I believe any pending asynchronous callbacks are fired to terminate said callbacks. It's by design so it's something you need to handle in your code. When you call EndReceive (or EndAnything for that matter) it can can throw any number of exceptions to indicate failures from the pending operation so those methods should always be wrapped in a try {} catch (stuff) {} block. Basically, anything the synchronous versions of the methods can throw, the asynchronous ones can throw too with some extra ones for good measure. Catching those exceptions is one way that your code could know that it should exit from the callback without initiating another async method call. Another way would be to check a flag in the receive callback that is set in CloseConnections to indicate that work is done.
It also looks like you might be being bit by a lack of thread safety. Async callbacks are executed on Threadpool threads so it's a good bet that CloseConnections and the receive callback are racing to use the socket at the same time. A simple lock(_recvState) { /* use the shared resources here */ } around places where the shared resource are used will be sufficient to protect them.
|
|
|
|