|
string input = textBox.Text;
if(!input.Contains("@"))
{
}
Does that help?
|
|
|
|
|
so for all special char i have to check seprately. is there is any method to check all of them at once or user would be not able to enter special char
thanks
|
|
|
|
|
Override the text box and overrid the following method
protected override bool ProcessKeyMessage(ref Message m);
There are other ways as well but this one is fairly simple.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Use a regular expression
only two letters away from being an asset
|
|
|
|
|
Hi all.
How can I get a Flash object to work correctly with the .Net 2.0 WebBrowser Control.
Best way to explain my problem is with a small project.
Open Visual Studio 2005 and create a Windows application (c# or VB).
on the main form, place a System.Windows.Forms.WebBrowser.
on the Forms load event, send the webbrowser to this page (http://www.helloworld.com.es)
scroll down the page until you reach the small color chart.
now click on the colors, you will notice it will only play the flash once.
In order to play the flash movie a second time you need to click anywhere on the page, then click on the flash movie again. The flash behaves as expected in all other browsers. (you can check with IE)
Has anyone please got some ideas for a work around.
many thanks
sean
-- modified at 15:12 Monday 24th July, 2006
|
|
|
|
|
Well It might be the behavior of the control. Have you viewed source to see that the Loop property isn't being changed?
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Hey, I'm corrently building an IRC bot, using Threshers \ SharkByte IRC client.
It has a Connection class, which uses Threads.
I have 2 forms, a connection form, and a controling form.
After the user sets the data in the connection form, and logs in, I need to "move" the Connection obj into the next form.
but I can't cuz the Thread is throwing an error.
How can I still do something with it? or how can I move it?
Please help.
NaNg.
"FEAR MY CAPS!"
|
|
|
|
|
Might be helpful to know what the error is you are getting.
only two letters away from being an asset
|
|
|
|
|
"cross-thread operation is not valid: control "frmconn" accessed from a thread other than the thread it was created on"
this is the error.
|
|
|
|
|
I'm not familar with the tools you mention but if frmconn is a windows control then it is not possible to "move" it to another thread. It must interact with the UI thread in which it was created.
only two letters away from being an asset
|
|
|
|
|
A connection object is not guaranteed thread safety when used between threads. So you may want to use separate connection objects for your threads.
Regards.
modified 17-Jul-19 21:02pm.
|
|
|
|
|
when is it appropriate to use a Dictionary and a Hashtable?
Dictionary <string, string=""> cacheLanguage = new Dictionary<string,string>();
Hashtable table = new Hashtable();
|
|
|
|
|
a Dictionary is a generic collection where as a Hashtable is just a collection. So if you need to use generics use a Dictionary, if you don't use a Hashtable. Otherwise, they are identical, think of a Dictionary as a Hashtable for generics, just like ArrayList and List.
btw, should be:
Dictionary<typeOfKey, typeOfValue> cacheLanguage = new Dictionary<typeOfKey, typeOfValue>();
-- modified at 14:53 Monday 24th July, 2006
|
|
|
|
|
Because a HashTable uses object for both the key and value it is possible to do soemthing like this
Hashtable ht = new Hashtable();<br />
ht.Add("one", 1);<br />
ht.Add(1, 1);
Not very type safe and it incurs the boxing/unboxing penalty. Where as the Dictionary uses the specified types for key and value the above would not be possible (unless you used object as the key)
only two letters away from being an asset
|
|
|
|
|
So basically the two does exactly the same thing, but Dictionary is just type safe? Does a Dictionary also hash the key when storing key/value pairs? They say Hashtables are optimized for fast retrievals and that is what I need for a multi-lingual website.
|
|
|
|
|
Mark Nischalke wrote: ht.Add("one", 1);
ht.Add(1, 1);
|
|
|
|
|
If you have very few items a hashtable is the fastest.
A Dictionary is still a key value pair and boxes unless you use a generic.
Dictionaries are easier to use than a hashtable. But, since you will be storing many words or something, then a dictionary would be more useful to store unique sets. But, then again thats why globalization namespace was made.
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Dictionary class is implemented as a hash table and it's a generic class and performance wise it's close to O(1). Therefore I'm not sure why would one use hash table unless for backward compatability.
More here:
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref2/html/T_System_Collections_Generic_Dictionary`2.htm
Regards.
modified 17-Jul-19 21:02pm.
|
|
|
|
|
I'm trying to wrap my head around this pattern and apply it to some real world designs.
One thing I'm not sure about is whether tiny bits of logic should go out of the View (the WinForms control) and into the Presenter. Take the following code for example:
myMenuItem.MouseUp += MyMenuItemMouseUpHandler;
void MyMenuItemMouseUpHandler(object sender, MouseEventArgs e)
{
if(e.Button == MouseButtons.Right)
{
ShowOurContextMenu();
}
}
That is in the View (it's inside a WinForms control class). Since there is logic going on here, it seems maybe the logic part should be rolled out of the View and into the Presenter. Is that right? If that logic should go in the presenter, what would the code look like?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Messianic Instrumentals (with audio)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Hi, Judah.
1. Is ShowOurContextMenu() a part of your IView interface?
2. Does your Presenter know about myMenuItem or this is a private part of your view?
3. Does this behaviour common for all views or it is specific only for the concrete view?
|
|
|
|
|
ShowOurContextMenu is not part of the interface, but it easily could be.
The presenter does not know about myMenuItem.
This behavior is for only one particular view.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Messianic Instrumentals (with audio)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Then I think you should leave this menu logic in the specific view and don't burden Presenter with it. Presenter must describe the logic which is common for all views.
|
|
|
|
|
i select date field from data base this can be null value
i disply it's data by date time picker i want from the date time picker to
by null value when the field has null value
and when i insert the value to this field sometimes i need null value for intry
how can i solve this problem
thanks for help
MD_NADA
|
|
|
|
|
You can deal with this in the OnFormat and OnParse events of the databinding.
I don't have time to provide an example, but you should be able to find on in MSDN.
|
|
|
|
|
What I wanna know is why they named it a DateTimePicker when you can only pick the date.
|
|
|
|