|
Thanks!
There is no spoon.
|
|
|
|
|
When I dispose Control calling Control.Dispose() method, deactivate window and then re-activate window, I get ObjectDisposedException .
Does anybody know how to avoid Windows.Forms creating handle of a disposed control?
|
|
|
|
|
If I'm reading this right. You have a form with a control, and then in your code you dispose of the control? So when you try to activate the window it throws the exception about the disposed object? That's because your form thinks it still exists when you go to re-activate the window. Before you dispose the object, you should remove it from the form with form.controls.remove(yourControl). Then you can dispose of the object all you want.
|
|
|
|
|
When I use Controls.Remove(Control), the form start to working weird. It seems to be inactive (light blue) and blinking when clicked, but still keeping inactive.
I also tried to use SuspendLayout() and ResumeLayout() methods. Nothing changed.
And when all things worked (I had to remove more controls), Windows.Forms already tried to access correctly REMOVED and DISPOSED object calling its CreateHandle() method.
The last thing I've done was to change design of my app. I have no more time to solve these bugs, maybe later.
Thanks for answer!
|
|
|
|
|
Hi Every Body
I want to use Visual Studio.Net Code Editor in my Winform Application to make a script editor. Is it possible to use Visual Studio.Net Code editor.
I need text highlighting and auto expression completion in my script editor.
Thank you for your help.
|
|
|
|
|
|
I would like to develop a Clock Application. It should not depend upon the System clock. That is when the System time changes the clock tmie should not change. The clock should run independantly. Please give me the code or Logic. Thanking You
Suseel Kumar P
-- modified at 3:44 Saturday 3rd September, 2005
|
|
|
|
|
You can use System time as well. Only difference between system and your time could be a shift.
Look at the DateTime structure at MSDN or somewhere else. Your can set your clock to any time you want, then compute a shift between your time and system time. Everywhen you want to update your time, just compute: system time + difference. It's not extremely accurate (in the mean of milliseconds), but it may be enough for your application.
|
|
|
|
|
having the typeof(something), can I create a new (default constructed) instance from that?
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
Yes, see the Activator.CreateInstance method.
-Atul, Sky Software http://www.ssware.com
Shell MegaPack For ActiveX & .Net - Windows Explorer Like Shell UI Controls
|
|
|
|
|
Yes, use the Activator.CreateInstance method.
-Atul, Sky Software http://www.ssware.com
Shell MegaPack For ActiveX & .Net - Windows Explorer Like Shell UI Controls
|
|
|
|
|
|
00001 <br />
00038 #include <stdio.h><br />
00039 #include <sys/types.h><br />
00040
00041
00042 #include "wildmat.h"<br />
00043 <br />
00044 <br />
00045 #define TRUE 1<br />
00046 #define FALSE 0<br />
00047 #define ABORT -1<br />
00048 <br />
00049 <br />
00050 <br />
00051 #define NEGATE_CLASS '^'<br />
00052 <br />
00053 #define OPTIMIZE_JUST_STAR<br />
00054 <br />
00055 #undef MATCH_TAR_PATTERN<br />
00056 <br />
00057 <br />
00058 <br />
00061 static int DoMatch(text, p)<br />
00062 register char *text;<br />
00063 register char *p;<br />
00064 {<br />
00065 register int last;<br />
00066 register int matched;<br />
00067 register int reverse;<br />
00068 <br />
00069 for (; *p; text++, p++) {<br />
00070 if (*text == '\0' && *p != '*')<br />
00071 return ABORT;<br />
00072 switch (*p) {<br />
00073 case '\\':<br />
00074 <br />
00075 p++;<br />
00076 <br />
00077 default:<br />
00078 if (*text != *p)<br />
00079 return FALSE;<br />
00080 continue;<br />
00081 case '?':<br />
00082 <br />
00083 continue;<br />
00084 case '*':<br />
00085 while (*++p == '*')<br />
00086 <br />
00087 continue;<br />
00088 if (*p == '\0')<br />
00089 <br />
00090 return TRUE;<br />
00091 while (*text)<br />
00092 if ((matched =<br />
00093 DoMatch(text++, p)) != FALSE)<br />
00094 return matched;<br />
00095 return ABORT;<br />
00096 case '[':<br />
00097 reverse = p[1] == NEGATE_CLASS ? TRUE : FALSE;<br />
00098 if (reverse)<br />
00099 <br />
00100 p++;<br />
00101 matched = FALSE;<br />
00102 if (p[1] == ']' || p[1] == '-')<br />
00103 if (*++p == *text)<br />
00104 matched = TRUE;<br />
00105 for (last = *p; *++p && *p != ']'; last = *p)<br />
00106 <br />
00107 if (*p == '-' && p[1] != ']'<br />
00108 ? *text <= *++p<br />
00109 && *text >= last : *text == *p)<br />
00110 matched = TRUE;<br />
00111 if (matched == reverse)<br />
00112 return FALSE;<br />
00113 continue;<br />
00114 }<br />
00115 }<br />
00116 <br />
00117 #ifdef MATCH_TAR_PATTERN<br />
00118 if (*text == '/')<br />
00119 return TRUE;<br />
00120 #endif /* MATCH_TAR_ATTERN */<br />
00121 return *text == '\0';<br />
00122 }<br />
00123 <br />
00124 <br />
00125 <br />
00128 int wildmat(const char *text, const char *p)<br />
00129 {<br />
00130 #ifdef OPTIMIZE_JUST_STAR<br />
00131 if (p[0] == '*' && p[1] == '\0')<br />
00132 return TRUE;<br />
00133 #endif /* OPTIMIZE_JUST_STAR */<br />
00134 return DoMatch(text, p) == TRUE;<br />
00135 }<br />
00136 <br />
00137 <br />
00138 <br />
00139 #if defined(TEST)<br />
00140 <br />
00141 <br />
00142 extern char *gets();<br />
00143 <br />
00144 <br />
00145 int main()<br />
00146 {<br />
00147 char p[80];<br />
00148 char text[80];<br />
00149 <br />
00150 printf("Wildmat tester. Enter pattern, then strings to test.\n");<br />
00151 printf<br />
00152 ("A blank line gets prompts for a new pattern; a blank pattern\n");<br />
00153 printf("exits the program.\n");<br />
00154 <br />
00155 for (;;) {<br />
00156 printf("\nEnter pattern: ");<br />
00157 (void) fflush(stdout);<br />
00158 if (gets(p) == NULL || p[0] == '\0')<br />
00159 break;<br />
00160 for (;;) {<br />
00161 printf("Enter text: ");<br />
00162 (void) fflush(stdout);<br />
00163 if (gets(text) == NULL)<br />
00164 exit(0);<br />
00165 if (text[0] == '\0')<br />
00166 <br />
00167 break;<br />
00168 printf(" %s\n",<br />
00169 wildmat(text, p) ? "YES" : "NO");<br />
00170 }<br />
00171 }<br />
00172 <br />
00173 exit(0);<br />
00174 <br />
00175 }<br />
00176 #endif /* defined(TEST) */<br />
<br />
|
|
|
|
|
|
hi this is ravi, i need code for setting our own timimgs in datetimepicker control rather than automatic.
regard ravi
|
|
|
|
|
hi!
I have to convert sqlserver database(table) to an excel file.I tried some code samples available.In some code samples,excel is used as namespace i.e. using excel is mentioned.but I am not able to compile it.please help me if you have any code to convert sql server tables to excel.
Thanking you ,
with regards,
srikanth.
mvssrikanth
|
|
|
|
|
hi!
I have to convert sqlserver database(table) to an excel file.I tried some code samples available.In some code samples,excel is used as namespace i.e. using excel is mentioned.but I am not able to compile it.please help me if you have any code to convert sql server tables to excel.
Thanking you ,
regards,
srikanth.
mvssrikanth
|
|
|
|
|
How do I declare a "Graphics g" inside this event handler?
Graphics g = new Graphics(); //DOESN'T WORK...
private void complexA_OK_Click(object sender, System.EventArgs e)
{
//Want to instantiate a Graphics object here....
}
thanks -- sorry, I know it's a stupid question....if you just want to tell me how dumb I am don't bother responding...
|
|
|
|
|
Write somthing like Graphics g=this.CreateGraphics(); this will get graphics object from the form the event handler belong
if you for example you want to draw in Picture box write
Graphics g=pictureBox1.CreateGraphics();
if you want to Draw on the image to get graphic write
Bitmap bm=new Bitmap(x,y);
Graphics g= Graphics.FromImage(bm);
MCAD
-- modified at 20:42 Friday 2nd September, 2005
|
|
|
|
|
thanks Mohammed, I will try it...
|
|
|
|
|
first of all sorry about my english, but it's all what I have
so, that's the question.
In all controls in the form in properties window (in the bottom right) appears
(DataBindings). What is this and how to use it? I heard that is helps to separate all stuff about how controls react for user's action. I mean, if user click checkbox some text field can be disabled.
|
|
|
|
|
I'm trying to determine the ip assigned by ISP.. so far I've thought of no direct way.. Is there a simple way to get your ip thru c#? not the 192.168.?.? I'm talkin about the external IP... I will continue my search but any links, pointers, similar frustrations would help a bunch
aspiringCodeMonkey says ...
|
|
|
|
|
There is no way of getting the external ip directly. It simply does not exist in the computer.
You have to send a request outside the local network so that the ip number can be detected and sent back to you. For this you need a server that will return the ip number to you.
There are a lot of pages out there that will tell you what ip address you are using. Like Aspsidan/IP[^]. You can use a page like that to get the ip number in the response. Ideal for you would be a page that returns only the ip number in plain text, and nothing else.
---
b { font-weight: normal; }
|
|
|
|
|
|
This is what I want to do:
<br />
abstract class Item<br />
{<br />
abstract Item(int x, int y)<br />
{<br />
x = X;<br />
y = Y;<br />
}<br />
}<br />
class Transistor : Item<br />
{<br />
Transistor(int X, int Y)<br />
{<br />
x = X;<br />
y = Y;<br />
}<br />
}
But it wont work.
How could I solve it?
I got an idea on how to do it...
Like this:
<br />
abstract class Item<br />
{<br />
abstract Item(int x, int y)<br />
{<br />
x = X;<br />
y = Y;<br />
this.init();<br />
}<br />
}<br />
class Transistor : Item<br />
{<br />
init(int X, int Y)<br />
{<br />
}<br />
}
But isn't there a better way?
Niklas Ulvinge aka IDK
|
|
|
|