|
Hi, im making a custom control inherited from System.Windows.ListView. I would like to add a filters to its columns and others features to work with datatables y detalis view.
Its possible to add a textbox control to an columnheader or to and items of lisview?
Can I only had fiters using System.Runtime.InteropServices messages overrating winproc way?
How can I capture keypress, keyup, or keydow of filters of lisview (System.Runtime.InteropServices messages overrating winproc (IE))
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
You're writing a custom ListView and you have no ideas about any of this stuff?! You should read some of the articles on this site, such as the ListViewFilter Control for .NET[^].
The ListView already has events for the keyboard. If you're looking for information on all the messages, see the Platform SDK in the Common Controls section for the List-View common control reference.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thank you, in this moment i have my custom control in this way (using your tips) adding at run time textbox for each colum in listview and works fine, usinf the keyup event (enter key) of textbox for make the filter. But this has a problem when the colums are bigger than the lisviww.width or resize the column.width. For that I try changing the size of textbox at the time when the column do it and work fine. Or making the colums fixed.
Then Found ListViewFilter a see the columns whit nice filters, but coulnt find to capture the event keyup of these filters only texchange an click the button of the filter.
In other hand i would like no use the interop with windows dll because i don want to take mi code with only .net and in the future use it in diferent plataforms.
La realidad no es más que impulsos eléctricos del cerebro - Morpheus
|
|
|
|
|
machocr wrote:
In other hand i would like no use the interop with windows dll because i don want to take mi code with only .net and in the future use it in diferent plataforms.
Right there you have a problem that you really need to understand. Almost every control in System.Windows.Forms encapsulates a native common control and by using messages they're already not portable (sort of). Ports like Mono/GTK to provide the same public and protected methods of classes but they implement them in a different way. Open source platforms like linux don't use a messaging system like Windows so overriding WndProc even for something simple will not work. Your custom control is already not portable.
Use what works - like the ListViewFilter I linked for you - and get it to work on Windows. Writing portable apps limits what you can do, and you need to understand how all that works.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I'm pretty new to C#. I have downloaded the bootstrapping sample and am having trouble getting it to work. I have placed the setup.exe file and the settings.ini file in the same folder as the .msi file. Here is my modified settings.ini file.
[Bootstrap]
Msi= Hydrolog Setup.msi
'LanguageDirectory=
'ProductName= Hydrolog
'DialogText=
'CaptionText=
'ErrorCaptionText=
'FxInstallerPath= c:\
When I start setup.exe I get a MessageBox that says "To start Application Setup, click OK. To quit without installing, click Cancel." When I click on the OK button I then get another MessageBox that says incorrect command line parameters.
Am I not doing something? Can someone help me out?
|
|
|
|
|
You realize "bootstrapper" is a generic term, don't you? What bootstrapper are you talking about? If it's one on the CodeProject site, then ask in the article's message board at the bottom. Those message boards are for specific questions / comments regarding the article.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I was referring to the bootstrapper example that is on the Microsoft website. http://www.microsoft.com/downloads/details.aspx?FamilyID=bf253cfd-1efc-4fc5-ba7e-6a6f21403495&DisplayLang=en
|
|
|
|
|
Try putting the .MSI file in quotes since it includes spaces. This is common. Also, if you're set other properties you need to remove the comment character ' . There is documentation[^] that you should read.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Got it to work!! Thanks for the help. The Probelem was the name of my msi file. I changed it to one word and it worked.
|
|
|
|
|
I had to disable Task Manager in Windows XP using C# application. This can be done by writing a Registry Key under Policies in Registry. But the problem i am facing is that when i a logged in as a limited user, it so happens that the Windows XP does not allow a ristricted user to access this part of the registry. Hence i will not be able to create/modify that perticular key in the registry.
Please tell me how to sort out this probelm.
CHEERS
I.T. D.U.D.E
|
|
|
|
|
You can't. Security permissions are there for a reason. You could simply use a group policy instead to write that value rather than writing an application to do it, which is the correct way to deploy such a policy in a domain.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
Hi
How can Set The Time Or Date in c#?
i can get those but i don't know how set.
Regards' Amir Jalaly
|
|
|
|
|
.NET is too high-level for things like setting the system time. You'll have to P/Invoke the native function SetSystemTime and re-define the SYSTEMTIME struct:
[DllImport("kernel32.dll")]
private static extern bool SetSystemTime(ref SystemTime time);
[StructLayout(LayoutKind.Sequential)]
private struct SystemTime{
[MarshalAs(UnmanagedType.U2)] public short Year;
[MarshalAs(UnmanagedType.U2)] public short Month;
[MarshalAs(UnmanagedType.U2)] public short DayOfWeek;
[MarshalAs(UnmanagedType.U2)] public short Day;
[MarshalAs(UnmanagedType.U2)] public short Hour;
[MarshalAs(UnmanagedType.U2)] public short Minute;
[MarshalAs(UnmanagedType.U2)] public short Second;
[MarshalAs(UnmanagedType.U2)] public short Milliseconds;
} Fill-in an instance of the SystemTime struct and call SetSystemTime(ref obj), where obj is the instance of your struct.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I need to detach and then re-attach my MSDE db from within my C# application.
Can someone give me a clue on how to do this? I have no problem doing it in Querey Analyzer but can't seem to make the transition into C3?
Thanks,
cb
|
|
|
|
|
Connect to the master database and simply execute the sp_attach_db stored proc on the database (using all three parameters, using paths local to the target machine - not yours!) like so:
SqlConnection conn = new SqlConnect(
"Integrated Security=SSPI;Data Source=DBSRV1;Initial Catalog=master");
SqlCommand cmd = conn.CreateCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "sp_attach_db";
cmd.Parameters.Add("@dbname", SqlDbType.NVarChar, 128).Value = "MyDB";
cmd.Parameters.Add("@filename1", SqlDbType.NVarChar, 260).Value =
@"C:\Program Files\Microsoft SQL Server\MSSQL\Data\MyDB.mdf";
cmd.Parameters.Add("@filename2", SqlDbType.NVarChar, 260).VAlue =
@"C:\Program Files\Microsoft SQL Server\MSSQL\Data\MyDB.ldf";
try
{
conn.Open();
cmd.ExecuteNonQuery();
}
finally
{
conn.Close();
}
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks Heath,
I'm getting an "Unrecognized escape sequence" for the values for filename1 and filename2.
Doesn't like the '\'.
I tried putting the value in paren's but that didn't help either.
cb
|
|
|
|
|
betterc wrote:
I'm getting an "Unrecognized escape sequence" for the values for filename1 and filename2.
Doesn't like the '\'.
You'll need to use \\ rather than a single \
Michael
CP Blog [^]
|
|
|
|
|
Thanks I figured it out (@"\bla\bla\bla");
|
|
|
|
|
Either escape them using "\" (so "\\") or use the literal string identifier "@" before the string, like "@C:\Program Files...". Looking at the documentation for the compiler error would've told you that.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello gurus,
I would like to know how can I retrieve the IPv6 address of the current computer in C#? IPv6 is activated under Windows Server 2003 and I activated it under Windows XP.
In my application, I would like to use IPv6 instead of IPv4. Is it an advantage that new application are ready for IPv6?
Thanks for your help.
Best regards.
There is no spoon.
|
|
|
|
|
What happens when you run this?
<br />
using System.Net;<br />
<br />
<br />
IPHostEntry hostEntry = Dns.GetHostByName(Dns.GetHostName());<br />
IPAddress[] addresses = hostEntry.AddressList;<br />
for(int x = 0; x < addresses.Length; x++) {<br />
Console.WriteLine(addresses[x]);<br />
}<br />
Regards,
Jeff Varszegi
EEEP! An Extensible Expression Evaluation Package
|
|
|
|
|
I have the following:
"::1 192.168.0.110 192.168.204.1 192.168.74.1"
which does not seem to be an IPv6 address.
There is no spoon.
|
|
|
|
|
::1 (with scope ID 0) is the local hosts's IPv6 address.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Heath!
I'm working on the multi-player mode of my game. I want to use IPv6.
::1 is the scope. okay. but how can I get the physical address of the host? like for IPv4? I have IPv6 enabled on .NET 1.1.
According to Gary Brewer's article (http://www.codeproject.com/csharp/ipv6.asp) an IPv6 address looks like this:
"xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx"
his article shows how to use IPv6 wiht .NET 1.1 sockets but it does not shows how to handle addresses.
When I do ipconfig /all with IPv6 activated, I can read my IPv6 address. I would like to do display the IPv6 address of the host.
Thanks for the help.
There is no spoon.
|
|
|
|