|
Does anyone know how to increase the line spacing of items in a checkedListBox control, thank you in advance for your comments.
Interlocked
|
|
|
|
|
Hello, i have this web browser application which uses the AxWebBrowser control. It works pretty well except that i doesn't support auto complete. e.g. when u double click on an empty textbox, it will display a list of previous entered values.
Does it need special coding to handle it or can it be just a simple turning on of certain option?
<font=arial>Weiye Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
|
Hi All,
For my .NET Windows application (C#), I build the installation setup from .NET framework (Setup & Deployment Project).
I am unable to find the property, which I can set to give user the choice for installation i.e. whether installation will take place for the logged in user or for everyone [Everyone /"Just me" thingy]
Any help is appreciated
Thanks
Ruchi
|
|
|
|
|
So u are in C# right ?
good shoot.
First you create a new project
File > New >project >Setup and deployment > Setup. Just mentione the name and location where you want to keep your setup file.
Second Stage > Right now you are in FileSystem Window. Am i right ?
Ok. Here you can see Application Folder ,user's Desktop, User's Programs Menu some thing like this.
third stage > Choose add project from File Menu and choose existing project. After this you have to mention for which project file that you need to create setup file. Choose you project directroy.Choose the file
yourprojectname.csproj.
Just wait a second. After this stage right click the application folder and choose the option Add > Project Output.
Choose all in ProjectListBox except DebugOut Put And Source File. Then choose Cofiguration Tab and select Active.
then click ok.
You will get some file in the second Splited window of FileSystem Window.
Here you can view the two part of FileSystem Window.One is FileSystem on Target Machine and the other window is Output files. Select the application folder and right click on the next window.You will get a popup window with an option add. Choose the Add and go for the File option.
Here you can choose all aditional resouces file that you are going to use in your project.eg. icon's, configuration file etc.
Choose the all required files holding ctl key and add it. Here you got some more file right. Ok.
Next thing is if you want to give short cut to your project, then right click on the file
Primary output from xxxx(Active) and choose create shot cut. Now u will get one more file and rename it to what ever you want.
Choose the property of that shortcut and choose the Icon and browse in application folder. In application forlder you will get your project icon.
And create the project(build). If your project is error free then your effort will always successfull.
enjoy coding.
hai, feel free to contact
Sreejith SS Nair
|
|
|
|
|
Thanks Sreejith for the reply.
Actually I could create the setup project, but problem I have is in specifying property such that at the time of installation it asks me, if the installation is to be done for "All Users" or "Logged in user"
Thanks
Ruchi
|
|
|
|
|
I don't know what in the hell the other guy is trying to tell you, but I've been developing installer packages since Windows Installer 1.0 beta.
The solution is simple: the ALLUSERS property is what you're looking for. You can both get and set this property.
The default Windows Installer project in VS.NET does include a dialog that sets this accordingly (see the Windows Installer SDK in MSDN[^] for more information). This in turn changes the meaning of pre-defined folder properties, like DesktopFolder . Depending on the user's access privileges and the setting of ALLUSERS , the DesktopFolder - for example - would point to either the user's desktop folder or the All Users' desktop folder.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks Heath for the reply.
The solution you suggested works by specifying command line params like this
msiexec /I mysetup.msi ALLUSERS=2
But I couldn't find a way such that I set this property at the time I create MSI file from the .NET "Setup & Deployment" project.
I am sorry I am a little novice there. Please suggest.
Thanks
Ruchi
|
|
|
|
|
i need a solution for making an event (like click event..) on the scrollbar of the TreeView.
|
|
|
|
|
Extend the TreeView with your own class and override WndProc . Inside, you can handle the scroll bar notification messages that can fire whatever events you want, such as adding your own. For example, you could have a Scroll event and fill it's EventArgs derivative with scroll information, which you can also get from the WParam and LParam properties of the Message that's passed as a reference to your overridden WndProc (just don't forget to call base.WndProc ).
You can find more information about the scroll bar notification messages - which are sent to the parent control, i.e. the TreeView - in the Platform SDK documentation for Scroll Bars[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I'm building some Control that displays a form that let's me do some operations. (like the combobox, datetimepicker, etc.)
Now, I nees that the poped area will be on top of all windows like the regular ComboBox dropped region, and wouldn't be trimmed by the parent control rectangle.
What is the currect technique for this?
(Sorry about my terrible English, I'm not an american.)
|
|
|
|
|
One approach would be to...
Make the popped-up area a parentless, topmost Form that holds whatever custom control you wish. You can initialize it something like:
protected void InitMyPoppedForm
{
...
this.TopMost = true;
this.Deactivate += new System.EventHandler(this.MyPoppedForm_Deactivate);
...
}
Then you need to handle the Form's deactivate event, which fires when the user clicks anywhere else other than inside the MyPoppedForm. At the very least this should simply close the popped up form (like a combobox "rolls up" when it loses focus).
Something like:
private void MyPoppedForm_Deactivate(object sender, System.EventArgs e)
{
Hide();
NotifySomeoneILostFocus();
}
Hope that helps.
Michael
Developer, Author, Chef
|
|
|
|
|
I've tried this approach, but when the form poppes up, thw hosting form is loosing focus. i.e. the caption color of the form changes to gray.
In the combobox it stays blue even when it dropped down.
What can the reason for this?
Thanks for answering.
|
|
|
|
|
Hi-
I have a c# program which encrypts a password and stores it in an access database (into a text field with 150 char). When I try to decrypt it, it tells me "bad data".
Here is how I encrypt it:
//Create a UnicodeEncoder to convert between byte array and string.
UnicodeEncoding ByteConverter = new UnicodeEncoding();
//Create byte arrays to hold original, encrypted, and decrypted data.
byte[] dataToEncrypt = ByteConverter.GetBytes(this.editHeartsPsWd.Text.ToString());
byte[] encryptedData;
//Create a new instance of RSACryptoServiceProvider to generate
//public and private key data.
RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();
//Pass the data to ENCRYPT, the public key information
//(using RSACryptoServiceProvider.ExportParameters(false),
//and a boolean flag specifying no OAEP padding.
encryptedData = HallenSchool.HallenFunctions.RSAEncrypt(dataToEncrypt,RSA.ExportParameters(false), false);
string sSQL="UPDATE Staff SET Staff.HeartsPsWd = '" + ByteConverter.GetString(encryptedData) + "' WHERE Staff.[Staff Code]= " + this.editStaff_Code.Text.ToString();
Here is how I decrypt it:
//Create a UnicodeEncoder to convert between byte array and string.
UnicodeEncoding ByteConverter = new UnicodeEncoding();
//Create a new instance of RSACryptoServiceProvider to generate
//public and private key data.
RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();
byte[] decryptedData;
byte[] encryptedData;
string strHeartsPsWd = this.editHeartsPsWd.Text.ToString();
strHeartsPsWd = strHeartsPsWd.Trim();
encryptedData=ByteConverter.GetBytes(strHeartsPsWd);
if (!(encryptedData.Length==0))
{
decryptedData = HallenSchool.HallenFunctions.RSADecrypt(encryptedData,RSA.ExportParameters(true), false);
this.editHeartsPsWd.Text= ByteConverter.GetString(decryptedData);
}// not empty password
Thanks for your help!
JK
|
|
|
|
|
First, don't use Text.ToString : Text already returns a string - your call to ToString is completely unnecessary.
Second, you're treating binary data as text, which can cause encoding problems. If you want to encode binary data as text, then you should chain something like the ToBase64Transform or FromBase64Transform or simply use Convert.ToBase64String or Convert.FromBase64String .
Finally, the problem is most likely in your RSADecrypt method that you're not displaying. Everything you're doing besides that is simply encoding and decoding and should not throw such an exception that uses the "Bad data" message.
Please be more specific. What exception is being thrown and from which line? Step through your code and determine exactly where the error occurs.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi -
The RSADecrypt is:
static public byte[] RSADecrypt(byte[] DataToDecrypt, RSAParameters RSAKeyInfo,bool DoOAEPPadding)
{
try
{
//Create a new instance of RSACryptoServiceProvider.
RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();
//Import the RSA Key information. This needs
//to include the private key information.
RSA.ImportParameters(RSAKeyInfo);
//Decrypt the passed byte array and specify OAEP padding.
//OAEP padding is only available on Microsoft Windows XP or
//later.
return RSA.Decrypt(DataToDecrypt, DoOAEPPadding);
}
//Catch and display a CryptographicException
//to the console.
catch(CryptographicException e)
{
System.Windows.Forms.MessageBox.Show(e.ToString());
return null;
}
} //end RSADecrypt
***** The exception is thrown at the return RSA.Decrypt(DataToDecrypt, DoOAEPPadding);
statement.
Thanks for your help!
JK
JK
|
|
|
|
|
Like I mentioned before, it's probably because you're treating binary data as text. Try just storing the encrypted data in a byte[] array and then decrypt that, as opposed to putting it in a TextBox (or whatever you are storing it in) and decrypt that and see what happens.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have class like this
Public class A
{
private string stra1;
public string geta1 {
get{ return stra1;}
}
public void seta1{string sa1)
{
stra1=sa1;
}
public a{
//contructor
}
//Inner class
public class b
{
private string strb1;
public string getb1 {
get{ return strb1;}
}
public void setb1{string sb1)
{
strb1=sb1;
}
public b{
//contructor
}
}
How can i access the inner class now??
|
|
|
|
|
From inside class A , just instantiate B . From outside class A , you can instantiate A.B .
FYI, class B can access private members of class A , and instantiating class A does not instantiate class B .
You typically nest classes to either show dependency of the nested class on the outer class or to mark the nested class as private so that only the outer class can access it (it still needs a public or internal constructor, though).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Consider the following code...
public class Outer
{
public Outer() { }
<br>
public class Inner
{
public Inner() { }
}
}
The Inner class can be accessed as follows...
Outer.Inner i = new Outer.Inner();
|
|
|
|
|
A small annotation that doesn't deal with your question.
Instead of the public get- and set-methods, use properties to offer access to your private class members.
<br />
private string stra1;<br />
public string Stra1<br />
{<br />
get<br />
{<br />
return this.stra1;<br />
}<br />
set<br />
{<br />
this.stra1 = value;<br />
}<br />
}<br />
Afterwards you can access the property like a public variable.
<br />
A obj = new A();<br />
obj.Stra1 = "string";<br />
string x = obj.Stra1;
|
|
|
|
|
Urgent.. need a sw that cuts video into images and compatible with .NET
or
access the video from the program using C#.net then convert the frames into images
count the frames in the video
set a index for each image
|
|
|
|
|
Hi
Well, my question today is how I could use a dataset into a PivotTable??
I try to use a PivotTable v10 into my C# project, and I wanna bind it from a dataset, but I don't know how. The PivotTable just can be binded from a DataSource
If someone work with PivotTable in C#, please help me.
Thanks
----
hxxbin
|
|
|
|
|
It must bind against an ADO data source, not an ADO.NET data source. In order to do this, you must import the ADO typelib. If you have installed VS.NET, it is recommended that you use the Primary Interop Assembly (PIA) created by Microsoft, adodb.dll. This is found by default in Program Files\Microsoft.NET\Primary Interop Assemblies.
You use ADO much like you use ADO.NET: you create connections and commands and execute that command to get back an ADO recordset, which you can then set as the PivotTable.DataSource property value.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks, I better try to use ADO , I don't know how use PIA It's hard to use PIA??
----
hxxbin
|
|
|
|