|
MS Office
open your favourite office product, right click on the toolbar, select customize, in the Commands tab select All Commands, drag the command with the icon you want onto a toolbar, now right click the button on the toolbar and select Copy Button Image, now go paste it into your favourite image editor.
[disclaimer] of course you should not be using these icons for commercial applications
|
|
|
|
|
|
It is rather a simple problem (it looks like that).
Once I set the first item visible in a comboBox (comboBoxName.SelectedIndex = 0)
I notice a difference between the comboBox behavior in Windows 2000 and Windows XP.
In Windows 2000 the selected item is visible in the comboBox (it works fine) but in Windows XP the selected item is visible in the comboBox and it is also HIGHLIGHTED (MARKED).
How to make it just visible (like in Windows 2000) and NOT HIGHLIGHTED?
Thanks for help in advance.
misiek
|
|
|
|
|
Hello!
I program with Configuration management application block (CMAB)
I need to use configuration file that has more than two levels:
<Section>
<SubSection>
<SubSection>
<Element>
</SubSection>
</SubSection>
</Section>
How can I do it using CMAB? ConfigurationSectionHandler?
|
|
|
|
|
Hello!
I program with Configuration management application block (CMAB)
I need to use configuration file that has more than two levels:
<Section>
<SubSection>
<SubSection>
<Element>
</SubSection>
</SubSection>
</Section>
How can I do it using CMAB? ConfigurationSectionHandler?
|
|
|
|
|
Hi, I have created my own control that inherited TextBox.
I override the OnValidating event to check the text against database. The problem is that this happens everytime I leave the control, even if I click on a button which is not the desired behaviour. I tried to set "causes validation " property on the button , but this does not have effect. The only thing that make a change is when I set "Causes validation=false" on my control, but then this event doesn't fire at all.
Help please,
MitDej
|
|
|
|
|
hi,
i want to know any good books for .net xml, webservices? i want to get a better understanding on XSD, xml validation, xml serialization etc...
i heard that professional asp.net by Wrox is quite good. any comments?
anyone can help?
regards,
jim
|
|
|
|
|
hi,
i want to know any method to implement popup menu in C#?
any help for starting?
thanks,
jim
|
|
|
|
|
Start with a form, and set the BorderStyle to None.
Remove the WS_POPUP style bit, and add the WS_EX_PALETTEWINDOW style:
int nStyle = GetWindowLong(this.Handle, GWL_STYLE); nStyle^=Win.User.WS_POPUP;
nStyle^=Win.User.WS_POPUPWINDOW;
SetWindowLong(Handle,GWL_STYLE,nStyle);
int nExStyle = GetWindowLong(this.Handle, GWL_EXSTYLE);
nExStyle|=WS_EX_PALETTEWINDOW;
SetWindowLong(Handle,GWL_EXSTYLE,nExStyle);
This is needed because otherwise the active form loses focus when focus is on your popup, which is not good.
Grab the mouse capture with SetCapture() when the mouse is outside your menu, and release the capture with ReleaseCapture() when the mouse is inside your menu (so that any contained controls can get mouse messages). Close the popup when a MouseUp event is recieved and the mouse coordinates are outside of the form's bounds. You will also want to close the popup when it recieves a WM_APPACTIVATE message where the app being activated is not your own.
HTH!
|
|
|
|
|
is it platform invoke?
PInvoke again?
|
|
|
|
|
zecodela wrote:
is it platform invoke?
Yes.
[DllImport("user32.dll")]
private static extern int SetWindowLong(IntPtr hWnd, int Index, int NewLong);
[DllImport("user32.dll")]
private static extern int GetWindowLong(IntPtr hWnd, int Index);
readonly int GWL_STYLE=(-16);
readonly int GWL_EXSTYLE=(-20);
|
|
|
|
|
A couple more useful API declarations:
[DllImport("user32.dll", EntryPoint = "AnimateWindow")]
private extern static int AnimateWindow(IntPtr hwnd, int dwTime, AnimateWindowFlags dwFlags);
internal enum AnimateWindowFlags
{
Hor_Positive=0x1,
Hor_Negative=0x2,
Ver_Positive=0x4,
Ver_Negative=0x8,
Center=0x10,
Hide=0x10000,
Activate=0x20000,
Slide=0x40000,
Blend=0x80000
};
|
|
|
|
|
For a simple menu you can add a ContextMenu to your form.
If you want it to pop up when you like, not when the user right-clicks the form, use the TrackPopupMenu function:
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern bool TrackPopupMenuEx(
IntPtr hmenu,
int fuFlags,
int x, int y,
IntPtr hwnd,
IntPtr lptpm);
|
|
|
|
|
There's no need to P/Invoke for this, just use ContextMenu.Show()
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Hi
I have used this for the slq statem
SELCT FirtName, LastName, ID,From Coustomer WHERE FirstName LIKE '[A-Z]'
C#
private void button1_Click(object sender, System.EventArgs e)
{
oleDbConnection1.Open();
oleDbDataAdapter2.SelectCommand.Parameters["LastName"].Value = textBox1.Text;
dataSet11.Clear();
oleDbDataAdapter2.Fill(dataSet11)
oleDbConnection1.Close();
}
But when I run it gave a and error
can u help me anyone
Harrison Brock
|
|
|
|
|
SELCT FirtName, LastName, ID,From Coustomer WHERE FirstName LIKE '[A-Z]'
SELECT FirstName, LastName, ID FROM Customer WHERE FirstName LIKE ???
??? = I don't see what you want to do here. This is sure no SQL the like operater only allows to use wildcards % and _.
assume next records in DB:
cat
C#
dog
bat
faster
LIKE 'c%' returns cat and C#
LIKE 'c_' returns C#
LIKE '_a_' returns cat and bat
LIKE '_a%' returns cat, bat and faster
% for a range of caracters
_ for just 1 character
Let know what you want and I'll help you with the statement
Try this class named mySQL_Data with method get dataSet. (example with mysql)
public mySQL_Data(string userName, string database, string password, string host)
{
// constructor logic
this.userName = userName;
this.database = database;
this.password = password;
this.host = host;
conString = "DRIVER={MySQL ODBC 3.51 Driver};" + //place here the driver name like you
"SERVER="+host+";" + //find in Windows ODBC description
"DATABASE="+database+";" +
"UID="+userName+";" +
"PASSWORD="+password+";" +
"OPTION=3";
}
public override DataSet getDataSet(string query, string table)
{
OdbcConnection conn = new OdbcConnection(conString);
DataSet ds = new DataSet("name");
try
{
conn.Open();
OdbcDataAdapter da = new OdbcDataAdapter (query, conn);
da.Fill(ds, table);
conn.Close();
}
catch(OdbcException odbcError)
{
MessageBox.Show(
"Native: " + odbcError.Errors[0].NativeError.ToString() + "\n" +
"SQLState: " + odbcError.Errors[0].SQLState.ToString() + "\n" +
"Message: " + odbcError.Errors[0].Message,"ODBC Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
return ds;
}
greetz
|
|
|
|
|
I'm guessing the problem is in your select statement (I don't think LIKE '[A-Z]' can work). Can you post the specific error message?
|
|
|
|
|
I have a textbox that I want to enter a value in. Than search the database for the closes matches.
Harrison Brock
|
|
|
|
|
Ok I think you want something like
The user enters 'Arn' and sql gives Arnold
then your like statemint will be Like 'Arn%' or "... LIKE '" + TextBox1.Text + "%';";
Greetz
|
|
|
|
|
Hi, I'm trying to read some old .DBF files with C#. In C, I used Codebase and its available for several hundred dollars for .NET. The question is I also have Visual Fox Pro V8 for .NET. Will FoxPro read a .DBF database and the associated index files? I believe they are .CDX and .MDX files. If so I can save a few hundred $$.
Thanks,
Glenn
|
|
|
|
|
There is no way that you can use Visual Foxpro code to read data from DBF files, and use the data in a C# application. This is because Visual Foxpro is not CLS compliant.
Visual Foxpro only supports the OLE DB route for other applications to access data stored in DBF files.
If you are implementing a client-server application, then it should be possible to do a web-service that uses Visual Foxpro code for the web-method to read DBF files. The data returned by the web-method(s) may be used by any type of client that understands SOAP.
See Visual Foxpro Overview[^]
If you are only interested in reading the DBF files, then you can find many freely available C# classes.
|
|
|
|
|
Hi all.
I am a new learner of c-sharp and also this is my first mail in this group.I hope I will got my answer from here...
My question is that I have made a method which accepts an Object type and I have displayed the real runtime type and methods of any object passed to the method. the code is as follow:
public void display_record (Object O)
{
Type tmptype = O.GetType();
FieldInfo[] tmpproperties = tmptype.GetFields();
Console.WriteLine("Type = " + tmptype);
Console.WriteLine("lenght" + tmpproperties.Length);
for ( int tmppi = 0 ; tmppi < tmpproperties.Length ; tmppi++)
{
Console.WriteLine(tmpproperties[tmppi]);
}
}
Now i want to display the real values stored in the attributes of that object(like "ABC" stored in name attribute).How can i do that.Any idea??
Plz reply soon as help as I am in hurry n wana good solution ASAP.
Thanx to all helpers.
|
|
|
|
|
Change your last writeline to:
Console.WriteLine("{0} = {1}", tmpproperties[tmppi], tmpproperties[tmppi].GetValue(O));
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Hi,
I was experimenting on the printing functions and found out you can get a lot of information about a printer trough System.Drawing.Printing.PrinterSettings. But I'm missing the minimum margins where the printer can print.
Most printers can't print to the edges of a page. These margins varies for eacht printer. Where can we find this information?
thx.
|
|
|
|
|
mistery22 wrote:
can we find this information?
Check out the Margins[^] class.
-Nick Parker
|
|
|
|