|
I actually found a bug, where you can still get the context menu even when you do that.
If i remember right, to get the context menu to STILL appear, you right-click the text box and hold the button down - move you mouse off of the text box - and then release the button. Then the normal menu appears
My current favourite word is: Bacon!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Thanks for find.
How about handling this in WndProc method then?
|
|
|
|
|
hello,
I have an application that allow me to create many Forms.
When i open many forms i get this error : Error creating windows handle.
After i check for this kind of error, there is many suggestion to minimize the number of controls(handles) because each process do suppport a specified number of controls.
but my forms contain a user controls and more thing that i can't remove.
Do someone have any idea fr this kind of error.
Best regards,
dghdfghdfghdfghdgh
|
|
|
|
|
Hard to make sense of this. How many windows do you have open ?
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 )
|
|
|
|
|
about 50 windows
dghdfghdfghdfghdgh
|
|
|
|
|
Well, that is just a nightmare for the end user, but I don't see why Windows can't handle it.
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 )
|
|
|
|
|
error :
Error creating windows handle win32Exception
i think because the number of handle exceed a specifiv limit .
What to do ?
dghdfghdfghdfghdgh
|
|
|
|
|
Hey guys...
in my application all my forms inherit from cmdBaseClass which inherits from Form so essentially i have
myForm : cmdBaseClass : Form
now what i want is so inherit cmdBaseClass from a plain class (not a form) but i dont want to inherit Form because this class is not a form
the only way i can think of doing this is creating a 2nd cmdBaseClass and not inherit Form from that one...
is there a better way to do this?
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
There's no two ways around this b/c C# sucks and does not have multiple inheritance. If you want to be able to use a form and non form as if they are the same with respect to a group of functions, you can use an interface, but you still need to define it twice.
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 )
|
|
|
|
|
thanx CG
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
dude,
i made a 2nd cmdBaseClass now (does not inherit Form)...
now my "GlobalMethodsClass" needs to inherit the "Non Form CmdBaseClass" but GlobalMethodsClass is STATIC... it moans that static classes should inherit from objects
i don't get it? isn't cmdBaseClass an object? i thought EVERYTHING in an OOP language is considered an object
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
HarveySaayman wrote: i made a 2nd cmdBaseClass now (does not inherit Form)...
Two classes with the same name ?
HarveySaayman wrote: now my "GlobalMethodsClass" needs to inherit the "Non Form CmdBaseClass" but GlobalMethodsClass is STATIC... it moans that static classes should inherit from objects
If the class is static, then all your methods need to be static. I don't know if you can derive a static class from another.
Nope - static classes cannot have a base class. That does make sense, b/c what's the point of a class having a base, when no instances of that class can ever exist ?
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 )
|
|
|
|
|
Christian Graus wrote: Two classes with the same name ?
nope, one is named "cmdBaseForm" and the other "cmdBaseNonForm"
thanx for the help
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)
|
|
|
|
|
OK - so your only problem is that one is static. Just don't make it static, it's just syntactic sugar anyhow, to force you to make all properties/methods static. You can still do that in a non static class.
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!
Is there any way to get the table's definition (SQL Server 2005) in C#?
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
You can execute stored procedure "sp_tables" through code to get list of tables and "sp_columns @tablename" to get the name type etc of each column of a table.
|
|
|
|
|
Thanks for your reply, but i doubt if they are C# classes/libraries...!
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
These are stored procedures provided by SQL Server to get database and table schemas. You can run these using SQLCommand and read the out come using SQLDataReader class.
|
|
|
|
|
The Connection object provides you the "GetSchema()" method, which returns a DataTable filled with schema informations.
You have to specifiy what information you want in parameters of the method.
Example:
<br />
DataTable _indicesSchema = null;<br />
using (OleDbConnection connection = new OleDbConnection("Provider=SQLOLEDB;Password=******;Persist Security Info=True;User ID=sa;Initial Catalog=*****;Data Source=*******"))<br />
<br />
connection.Open();<br />
<br />
_indicesSchema = connection.GetSchema("Indexes", new string[] { null, null, null, null });<br />
<br />
connection.Close();<br />
<br />
}<br />
Hope was helpfull
Tiefe Brunnen muss man graben wenn man klares Wasser will,
tiefe Wasser sind nicht still.
|
|
|
|
|
Take a look at the GetSchema command on your connection object. It has all sorts of useful abilities for retrieving information about the database. I mention this one rather than directing you towards particular tables/stored procedures in the database because it gives you the option to discover information from lots of different database types.
|
|
|
|
|
How do i export the data from grid view to csv file in c#
|
|
|
|
|
Does this works?
StreamWriter oWriter = new StreamWriter("CSV File Path", false);<br />
for(int i = 0; i < oGridView.Columns.Count; i++) {<br />
oWriter.Write(oGridView.Columns[i].HeaderText);<br />
if(i < oGridView.Columns.Count - 1) {<br />
oWriter.Write(",");<br />
}<br />
}<br />
oWriter.Write(oWriter.NewLine);<br />
foreach(DataGridViewRow dr in oGridView.Rows) {<br />
for(int i = 0; i < oGridView.Columns.Count; i++) {<br />
oWriter.Write(dr.Cells[i].Value.ToString());<br />
<br />
if(i < oGridView.Columns.Count - 1) {<br />
oWriter.Write(",");<br />
}<br />
}<br />
oWriter.Write(oWriter.NewLine);<br />
}<br />
oWriter.Close();
modified on Wednesday, May 14, 2008 4:24 AM
|
|
|
|
|
Hope this will help you :
private void OnExportGridToCSV(object sender, System.EventArgs e)
{
StreamWriter sw = new StreamWriter(Server.MapPath("~/GridData.txt"), false);
DataTable dt = m_dsProducts.Tables[0];
int iColCount = dt.Columns.Count;
for(int i = 0; i < iColCount; i++)
{
sw.Write(dt.Columns[i]);
if (i < iColCount - 1)
{
sw.Write(",");
}
}
sw.Write(sw.NewLine);
foreach (DataRow dr in dt.Rows)
{
for (int i = 0; i < iColCount; i++)
{
if (!Convert.IsDBNull(dr[i]))
{
sw.Write(dr[i].ToString());
}
if ( i < iColCount - 1)
{
sw.Write(",");
}
}
sw.Write(sw.NewLine);
}
sw.Close();
}
|
|
|
|
|
Hi Friends,
I need to unzip the Images in C#.Please help me how to do?
Thanks & Regards
Senthil Kumar.T.S
|
|
|
|
|
What is inside a zip is completely irrelevant.
I believe the newer versions of C# have zipping built in, there are libraries you can buy and there's a library in J# that is widely documented for use in C#.
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 )
|
|
|
|