|
Hi all,
I have this bug where my main Form is getting set to WS_DISABLED somtimes and I don't know how it is happening since I am never explicitly doing this in my code (or at least not that I am aware of).
To make matters worse the Window Style event is never called for WS_DISABLED!
Does anyone have an idea how I can track what (object or other) is setting WS_DISABLED on my main Form?
It seems to be happening sometimes after I open and close a MessageBox, but the behavior is completely random. Sometimes the form locks up and sometimes it does not. Using Winspector I am able to change the window style to "re-enable" it and I am keeps running fine again.
Kind thanks,
Serge
|
|
|
|
|
How can i get the names of the tables in a database using System.Data.Odbc
sAqIb
|
|
|
|
|
select * from INFORMATION_SCHEMA.TABLES
|
|
|
|
|
can i use the same query to get the tables from a specific database e.g. from northwind
sAqIb
|
|
|
|
|
try
use northwind<br />
select * from INFORMATION_SCHEMA.TABLES
|
|
|
|
|
i tried above query, its working fine for sql server. But i also want to get the list of tables from other databases like oracle, mysql, ms access.
isn't there any single query which can get the list of all tables from any database?
sAqIb
|
|
|
|
|
I want to only int in text control how this can happen;
|
|
|
|
|
In case you use .Net 2.0 you can use the MaskedTextBox control.
Otherwise take a look at the following example copied from the MSDN topic of KeyPress event:
private bool nonNumberEntered = false;
private void textBox1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
nonNumberEntered = false;
if (e.KeyCode < Keys.D0 || e.KeyCode > Keys.D9)
{
if (e.KeyCode < Keys.NumPad0 || e.KeyCode > Keys.NumPad9)
{
if(e.KeyCode != Keys.Back)
{
nonNumberEntered = true;
}
}
}
}
private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if (nonNumberEntered == true)
{
e.Handled = true;
}
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi,
How can i get the path of the selected item from the listview.
Thanks In Advance.
Ravi
|
|
|
|
|
|
Hi,
i hace displayed the selected tree view node items in the list view control and upon selecting the item
i need to get the path of the item so that on clicking that item i should repopulate the listview with selected directory items.
Thanks
Ravi
|
|
|
|
|
In a DataGridViewComboBoxColumn I can get everything set up fine with the DisplayMember as one column of a DataTable.
Since the DataTable contains separate columns for firstname and lastname, and I'd like both displayed in the list, is there a way to set the DisplayMember property to show a combination of data columns (e.g. lastname + ", " + firstname)?
Or, am I going to have to perform the concatenation in some other part of the application/database?
|
|
|
|
|
Hi, I'm wondering if there are any differences between the System::Byte type , unsigned int and the unsigned char in terms of structure and performance?
They are all 8-bits long, am i correct?
Thanks
|
|
|
|
|
bankai123 wrote: They are all 8-bits long, am i correct?
No. an int is definately not 8 bit. What made you think that ?
int is 32 bit.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
woops, my mistake , so what are the differences between the System::Byte and a unsigned char?
|
|
|
|
|
I'd be astounded if there were any.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
This table might be of use, in C# chars are 16 bits.
|
|
|
|
|
Hi...I'm trying to develop a generic "Bar" class inside XNA and thought I would investigate a method(development method....not a literal C# "method") of accomplishing this and was hoping that someone might be interested as well.
What I am wanting to do is pass an "OrientationString" through the constructor and conditionally compile the update methods based upon this string. (I know that I could accomplish this task through inheritance....but that's one of the reasons why I'm not doing it that way)
The functionality I desire is:
I know the following code will not work...please don't reply saying as such
because I already know that. It is pseudocode
#undef HORIZONTAL
#undef VERTICAL
public Bar(int x, int y, string OrientationString)
{
this.x = x;
this.y = y;
#if(OrientationString.ToUpper().Equals("VERTICAL"))
{
#define VERTICAL
}
#elif(OrientationString.ToUpper().Equals("HORIZONTAL"))
{
#define HORIZONTAL
}
}
[Conditional("VERTICAL")]
public void UpdateVertical()
{
...
}
[Conditional("HORIZONTAL")]
public void Update HORIZONTAL
{
...
}
I basically want to control conditional compilation at run-time(*scratches head*......did I just say that?)
Does anyone know of a way to represent this logic in C#? I investigated the Attribute class but couldn't get very far with it.
-- modified at 23:58 Wednesday 4th October, 2006
|
|
|
|
|
First question that arrises is: Why do you want to do that? Can't you just include both methods in the application? This is most likely not possible to do in C# or any language for that matter.
WM.
What about weapons of mass-construction?
|
|
|
|
|
|
Not sure if its possible, but I have no idea why you would want to do it this way? You could just do an if/else sending execution to the proper method or if you end up having more than two options use a switch. Also, instead of a string use an enum. You are looking for a finite number of specific values (in this case 2, "HORIZONTAL" and "VERTICAL") by using an enum you force callers to pass valid values.
public enum Direction
{
Horizontal,
Vertical
}
public class Bar
{
public Bar(int x, int y, Direction dir)
{
this.x = x;
this.y = y;
if (dir == Direction.Horizontal)
UpdateHorizaontal();
else
UpdateVertical();
}
}
|
|
|
|
|
Can any one plz make a regular expression for me:
The input string is of the form:
BLAH BLAH ^##$[FRUIT]APPLE[/FRUIT] #$&&^*^%&^$%#@$ BLAH BLAH
I want to extract [FRUIT]APPLE[/FRUIT] from the above string firstly using Regex. After that i want to extract APPLE from [FRUIT]APPLE[/FRUIT] using Regex.
Can someone plz help me writing regular expression for this pattern. I am trying but ending in failure may be because of the presence of Big bracket '['
Imtiaz
|
|
|
|
|
use \[ and \] to insert the brackets. Google Expresso and download it, it's invaluable in these situations.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You don't need a regular expression to extract APPLE from [FRUIT]APPLE[/FRUIT].
string fruitType = fruitTag.SubString(7, fruitTag.Length - 15);
---
b { font-weight: normal; }
|
|
|
|
|
hi
u can use a tool like expresso to do some more RND on regular exp. It will guide u to write regular expresion. After that go to Tools/View Code it genearte ur C# code for that exp.
u can dowload this from . Its free
http://www.ultrapico.com/Expresso.htm
Regards.
|
|
|
|