|
Really great! Thanks Luc.
regards,
George
|
|
|
|
|
hi i would like to seperate my design page from validation. so i put the validation code in e.g validate.cs
design form
private void textboxInteger_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
validate.txtIntValidate(txtPhone.text)
}
in my validate class
class Validate
{
public bool txtIntValidate(string txt)
{
if (!Char.IsDigit(e.KeyChar) && e.KeyChar != (char)8)
{
e.Handled = true;
}
}
}
BUT in the validate.cs class .. how do i declare the e..
Error 3 The name 'e' does not exist in the current context
|
|
|
|
|
Good God.
e is not present because you have not passed it through. Even if you did, this method should be static, assuming this class should exist at all.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thank for the reply.. can u pls show some example to get all verification done is the class ? or at least guide me on declaring or passing the e
thanks
|
|
|
|
|
Passing variables is a fundamental coding practice. How do you think you might want to do it?
Here's a clue: The "e" parameter was passed into the function from which you're calling your validation function.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
i want website,ask me proje and say help solution(type code).
pliz help me, i need.
lots of tnx
|
|
|
|
|
I *think* you're asking us to write a website for you, but your question makes no sense. We try hard to understand that a lot of users do not speak English, but really, if we can't understand you, we can't help you.
It looks to me like you need to buy a book and work through it, b/c you seem to be saying you have no idea how to write your website.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello.
I have 2 questions for you
Question 1:
I got this method:
private void writeData()
{
StreamWriter writer = new StreamWriter(saveMonsterSetBase.FileName, false);
for (int i = 0; i < MonsterSetBaseDataArray.Count; i++)
{
writer.Write(MonsterSetBaseDataArray[i]);
}
writer.Close();
}
Which sort of works
It writes data from my arraylist to a file
The problem is it writes it in one line.
If my arraylist is like this:
line 1
line 2
line 3
It writes in the file like this:
line 1 line 2 line 3
How can I make a line changment?
Question 2:
I have a string that looks like this:
string testString = "1 10";
and I want to replace 1 and 10 with something
I replace it like this:
testString.Replace("1", "One").Replace("10", "Ten");
But the problem is that the output for 10 comes out as OneTen
Is there any way to replace 1 as just One and 10 as just Ten?
|
|
|
|
|
Soloution found:
1:
[writer.WriteLine(MonsterSetBaseDataArray);
2:
testString.Replace("10", "Ten").Replace("1", "One");
|
|
|
|
|
Hello everyone,
Using IFilter, I am trying to read name of the custom value-type property of a document. I got the Id and value but couldn't read the name.
So, can you please give me any suggestion or solution to solve my problem.
Thank you.
|
|
|
|
|
I have a Visual Studio Setup and Deployment project that associates a file type with my app. I have setup the file type in my Setup and Deployment project and ran the installer, however in windows explorer when you right click a file of that particular type and select "open with" it will show just the app's icon but no text is displayed next to the icon (usually the name of the application is shown here). Does anyone know what I'm doing wrong?
Note: if you double click the file it will successfuly launch the app correclty. It's just the application name in the windows explorer "open with" menu that doesn't show.
thanks
|
|
|
|
|
Did you set the application title and description in the Assembly Properties of the VS project? AFAIK, Windows Explorer pulls the display name of the application from that information.
|
|
|
|
|
Dear Friends,
I the project i am working on, i've a requirement of some very simple work related to active directory. Actually, i've to just query some data.
Now i am searching for some kind of article from which i can quickly learn only the basics of Active Directory, its installation and some basic programming of AD in C#.
If you are aware of any such resource(s) which can help me in quickly done my job then please tell me.
Sometimes google is not of much help and experience of friends is more useful.
Imtiaz
|
|
|
|
|
Here[^] Is a few.
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
|
Hi!
Obviously you didn't use CP's Search function - there are several articles giving a good introduction.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Does anybody have a good pattern for invoking methods on GUI controls from a different thread?
Writing all these shims is just downright annoying...
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
It turns out that System::Action comes to the rescue. I wrote this method in my GUI class:
void Invoke(Delegate del) {
Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Input, del);
} Then I add code like this in my delegate handlers:Invoke(new Action( () => { ... }));
I'm guessing I could create a generic delegate chain which automatically calls the Invoke method on an arbitrary Dispatcher object, so that the event handler always runs in the GUI thread context. Just one more thing to look into before going to bed...
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
Could you post a small example of how you use the Invoke method? I don't understand it.
|
|
|
|
|
Suppose I have an event handler:
void OnWhatever(...) {
textBox.Text = "Very bad thing from a different thread context";
} I rewrote it like this:
void Invoke(Delegate del) {
Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Input, del);
}
void OnWhatever(...) {
Invoke(new Action( () => { textBox.Text = "This is safe from a different thread context"; } ));
} This'll make sure that the textbox's text property is only set on the GUI thread. If you're used to COM, it's like calling an STA object's method - it gets synchronized by the message pump.
I've tried to make this more generic, so that when you register the event handler (which you know will be called from a different thread), you register a chaining delegate handler which will automatically chain the event call through the dispatcher. I haven't had any success yet, as the last step in the invocation list always gives me an invalid parameter count exception. I have no idea why, and the debugger doesn't give me much else.
Of course, I'm working with WPF. If you're working with Windows Forms, I think you'll have to take a look at Control.Invoke() or something like that, to dispatch the calls to the GUI thread.
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
Now it's more clear, thanks.
|
|
|
|
|
how to not allowing windows service shut down?
Best Regards.
Tayfun UZUN
Istanbul/Turkey
|
|
|
|
|
I may be wrong, but only system services are prevented from being stopped. In other words, you cannot prevent your own service from being stopped.
|
|
|
|
|
I have been searching all over the place for a way to put a C# form beneath the desktop icons. I have tried using SetWindowPos and I can find the handle for the desktop icons using:
IntPtr hDesktopListView = IntPtr.Zero;
IntPtr hProgman = (IntPtr)FindWindow("Progman", null);
IntPtr hDesktop = IntPtr.Zero;
if (hProgman != IntPtr.Zero)
{
hDesktop = FindWindowEx(hProgman, IntPtr.Zero, "SHELLDLL_DefView", null);
if (hDesktop != IntPtr.Zero)
{
hDesktopListView = FindWindowEx(hDesktop, IntPtr.Zero, "SysListView32", null);
}
}
return hDesktopListView;
However, no matter what I do, I can't place a form beneath the desktop icons. Can someone tell me if this is even possible to do?
|
|
|
|
|
I've never heard of it being done (apart from when Windows had Active Desktop but that was about it).
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
|
|
|
|