|
no i didn't but i want highlight specific words when it be written by user
|
|
|
|
|
Which happens to go by the name of "Syntax Highlighting".
|
|
|
|
|
i can't find what u told me "Syntax Highlighting"
can u tell me where i can found it
|
|
|
|
|
hi friends,
can i control the text to be typed in a textbox?
i.e. i want only hex data (A-F, 0-9)to be typed by the user, he should not be able to type any another data. i tried to use the keydown property
also, can i delete a perticular charater from the textbox?
i want the user to enter the MAC address in the form 3A:26:b9:12:34 in the text box. but when i process the text in the textbox, i want to exclude the ':'. how can i do it?
|
|
|
|
|
1. There should be an event when the textbox-contents changes.
-> get the string out of the textbox, check for illegal characters, delete them, put text back into the textbox.
2. Like 1., you can get and set the text from the textbox with the "Text" property.
look on msdn for more info on the textbox members and properties.
good luck.
No hurries, no worries.
|
|
|
|
|
1) Use the KeyPress event, if the character is invalid set the e.Handled property to false, and then it won't appear in the textbox.
2) Use macAddr = textbox1.Text.ToString().Replace(":", "")
Note this is from the top of my head and the syntax may be slightly off
Hope this helps
|
|
|
|
|
|
will any body out there help us.
we are in desperate need of a function to verify checksum of captured packets(tcp,ip,icmp).
we tried to use the func libnet_do_checksum() without any success.
|
|
|
|
|
Hello,
When I create a application in C#, a "public void" Main appears. This is the applications entry point. In fact, this sub has nothing to do with the class containing it. For example, it seems like this:
{
Application.Run(new Form1);
}
But when this Form1 has to load another form, for example to enter your name, and that second form has to store your name in a variable in the main form, how do you have to point to the form with wich the application started?
I've tried the following changement in the 'Main' sub:
{
Form1 f1 = new Form1();
Application.Run(f1);
}
I thought that I could point to the startup instance from Form1 by using 'f1' but this doesn't work. I've also tried it by setting an empty class only containing the "void Main" as startup object, but this also has no result. From the point where you use Application.Run... the instance isn't available anymore.
|
|
|
|
|
Anonymous wrote:
I thought that I could point to the startup instance from Form1 by using 'f1' but this doesn't work
The reason that doesn't work is that your variable f1 is only valid within the scope of the Main() method (not "sub")
I suggest that when you write the code that does the SecondForm.Show() you should pass a reference to this to the SecondForm. You will have to create a property in the SecondForm to accept the main form as a reference. Store this reference in a member variable.
For example:
SecondForm sf = new SecondForm();
sf.MyMainForm = this;
sf.Show()
Then when you have the variable that needs to be sent to the main form you can do something like this:
MyMainForm.Name = this.nameTextBox.Text; This will require a property on the main form to be set up to receive the variable.
Does this help?
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
How to pack and deploy C# .Net application using visual studio .NET 2003?
1) I am using deployment project (setup project) of VS .Net, it provides me a .msi file (windows installer). when i build,its taking all my applications(deliverables) within .msi file. But i need to take the applications from the given path and deploy it at the time of running windows installer. Is there any way?.
2. How to extract CAB files using windows installer?
3. Is there any way to create windows installer using C# .Net other than using deployment project of visual studio .net?
Kindly help me by providing solution to these..
Thanks
Rajasekaran
|
|
|
|
|
1. You can add extra files to the Windows Installer file using a Deployment Project. I don't know if it's possible to copy files from another location or run other installers from a Deployment Project. (You can always write your own "installer" using C#, as long as you make sure that .NET Framework is installed prior to running it).
3. There are some third party products available, for example Wise and InstallShield. There are also some free install systems, for example NSIS, but they don't use Windows Installer.
|
|
|
|
|
Thanks for ur reply.
But how to write my own installer using C#?
Regards
Rajasekaran
|
|
|
|
|
<company user="53601"><workspace id="12381" name="AdamWorkspaceTest" comment_section_term="crackTab" comment_term="funkie"><folder id="20241" name="[no folder]"><comment id="180741" name="View Count Test"><attachment id="5-180741-80621" name="PubsListUnread.gif" size="23085" last_updated="8 Oct 2004 15:23:36 GMT" downloadurl="/servlets/GetCommentAttachmentProxy?resourceId=180741&attachmentId=80621&wsID=12381" unread="N" checked="N"><attachment id="5-180741-80631" name="PusListRead.gif" size="25255" last_updated="8 Oct 2004 15:23:36 GMT" downloadurl="/servlets/GetCommentAttachmentProxy?resourceId=180741&attachmentId=80631&wsID=12381" unread="N" checked="N"><folder id="173231" name="1st Folder"><folder id="699101" name="012345678901234567890123456789012345678901234567890123456789"><folder id="1044991" name="012345678901234567890123456789012345678901234567890123456789"><folder id="1045001" name="012345678901234567890123456789012345678901234567890123456789"><document id="1372641" name="012345678901234567890123456789012345678901234567890123456789">
I have more than one WORKSPACE TAG, each tag with ID, Name & some other attribute, if i want to fetch all name attribute in Combobox,how can i do that ? i m using C#
Jatin Mehta
|
|
|
|
|
You can use the GetElementsByTagName method of an XmlDocument object. The method will return an XmlNodeList that is enumerable. The following code assumes that you have an XmlDocument set up in the variable xdMyXmlDoc.
XmlNodeList xnlElements = xdMyXmlDoc.GetElementsByTagName("WORKSPACE");
foreach(XmlElement xeThis in xnlElements)
{
// Do something
}
If you don't want to fetch XmlElements, change XmlElement within the foreach to whatever is in your Xml file.
|
|
|
|
|
<company name="" user="53601"><workspace id="12381" name="AdamWorkspaceTest" comment_section_term="crackTab" comment_term="funkie"><folder id="20241" name="[no folder]"><comment id="180741" name="View Count Test"><attachment id="5-180741-80621" name="PubsListUnread.gif" size="23085" last_updated="8 Oct 2004 15:23:36 GMT" downloadurl="/servlets/GetCommentAttachmentProxy?resourceId=180741&attachmentId=80621&wsID=12381" unread="N" checked="N"><attachment id="5-180741-80631" name="PusListRead.gif" size="25255" last_updated="8 Oct 2004 15:23:36 GMT" downloadurl="/servlets/GetCommentAttachmentProxy?resourceId=180741&attachmentId=80631&wsID=12381" unread="N" checked="N"><folder id="173231" name="1st Folder"><folder id="699101" name="012345678901234567890123456789012345678901234567890123456789"><folder id="1044991" name="012345678901234567890123456789012345678901234567890123456789"><folder id="1045001" name="012345678901234567890123456789012345678901234567890123456789"><document id="1372641" name="012345678901234567890123456789012345678901234567890123456789">
|
|
|
|
|
Hello
I have following problem:
I need to store in database Icons, but I don't want to use Blobs, I'd like to convert Icon in to String and store String in database and retrive Icons from String. I can do this , but the String is very-very long and I can't store in MSSQL database. Is any alghoritm for reduce length of string? Or have anybody a good advice?
Thank you
Victor
|
|
|
|
|
VictorVB wrote:
but I don't want to use Blobs
Storing binary data in a databaser is usually done using some form of BLOB field, SQLServer has the Image datatype which would work... can I ask why you dont want to do this?
VictorVB wrote:
but the String is very-very long
I assume you've used Base64 encoding to turn the binary data to a string, again this will work but I dont think there is a way to reduce the length of the data.
The only advice I can give you is to store the path to the file in your database (No BLOB Field and no long string data), but thats not what you said you wanted to do.
|
|
|
|
|
Thank you.
My idea is to Convert Icon in to primitive type like String or other else and sore in database, I want primitive base type like String, Long...not blob.
I can Convert Icon into byte-array and to string but...is to much long .
|
|
|
|
|
The string representation of Binary data is inherantly quite a large number of characters. It needs to be to represent quite alot of data.
Have you looked at Convert.ToBase64String() ? Thats about the best string-representation you're likely to find.
|
|
|
|
|
hi friends,
how can i bypass the button event on certain conditions?
like i can in while() loop using break statement.
|
|
|
|
|
You can attach and detach the eventhandler. If you look at the "Windows Form Designer generated code" you can see how the connection between the event and the code is done.
If the code that should be triggered by the event is in button1_Click the code would be as follows:
private void AttachEventHandler()
{
this.button1.Click += new System.EventHandler(button1_Click);
}
private void DetachEventHandler()
{
this.button1.Click -= new System.EventHandler(button1_Click);
}
But why don't you just check the conditions using an if statement in the event code?
|
|
|
|
|
thanks for replying
i tried using
this.button1.Click -= new System.EventHandler(button1_Click);
inside the button_click event
but the next time i click the button nothing happens.
|
|
|
|
|
Ofcourse. My example detach the link between the event and the code. You will have to use the attach function to restore the link.
In .NET, the Event - Code relationship is not like in VB6. You can programmaticly set up what code to execute when an event is triggered. You can even add more than one function to be called. I assumed this was what you were trying to do. If this is not what you need, I think you should add an if statement in the button1_Click function that checks the conditions before executing the code.
|
|
|
|
|
actually i have a main form which calls the input form as modal. there is OK and cancel button on the input form. if the user presses cancel the form closes. if the user presses OK the software checks if all the inputs are correct. in the main form i am using the dialogresult property of the input form. i have set ok as dialogresult of the OK button. so irrespective ofthe validity of the inputs the input form returns the dislog result.
this is why i was trying to exit the buttonOk_click event if the inputs were not valid.
|
|
|
|