|
no problem. glad I could help.
|
|
|
|
|
|
Diego F. wrote: Is there any way to solve that?
Yes, make sure the icon is in the imagelist of the listview and set the imageindex for the item to it.
led mike
|
|
|
|
|
I can't solve the problem.
When I open a file in the listview1 I do that (is vb code here)
Dim files As String() = Directory.GetFiles(sourceDir)
For Each file As String In files
ImageList1.Images.Add(System.Drawing.Image.FromFile(file))
Next
I added then something like listview1.LargeImageList = ImageList1
But when using drag & drop in the second listview, the images doesn't appear. Should I load the ImageList1 in the second listview? I thought that the item contains the image and when I drop in the other listview, moves it all.
Regards,
Diego F.
|
|
|
|
|
Hallo. I'm writing AddIn for Excel 2007 in C#, using VSTO 2005 SE. I'd like to have possibility to use something similar to templates - specially saved Excel objects (for example: a pattern of the table) for further use.
For example: I'll create an Excel table which represents information about person (Name, Surname etc.) and I'd like to paste this table in a Worksheet, allow user to fill it and then commit data to Database.
How can I do this without writing any code which will creates this table at runtime.
|
|
|
|
|
You should really post this question in the VSTO[^] forum.
If you were using VSTO, you could create an Excel document-level template and use that to gather up your data ...
As for dynamically creating a table and whatnot, I'm sure that someone in the VSTO group will be able to help guide you.
|
|
|
|
|
Thanks, Douglas, for your advice.
|
|
|
|
|
Hello,
My app dependes on a sql database I want my setup project to attach the sql files to the framework or any thing else to run the database like the MSDE 2000 How can I do this?
Thanks.
Dad
|
|
|
|
|
This question is far to vague. What database are you using (SQL Server, Firebird, MySQL)? What version of the .NET Framework?
You have to supply more detailed information.
|
|
|
|
|
I am esigning a usercontrol with a panel child. Using a ControlDesigner I used EnableDesignMode to make it possible to drop controls in the panel at design time. Now i wanted to lock te panel because you can move and resize the panel inside the usercontrol. I made another ControlDesigner class to use on the panel class and override the SelectionRules to set it to locked. If I use this locked thing, the functionality of dropping controls in the panel dissapears. Howe can I implement these two things without problems?
My code:
<br />
[DesignerAttribute( typeof( AdvancedNoteDesigner ) )]<br />
public partial class AdvancedNote : UserControl<br />
{<br />
...<br />
}<br />
<br />
public class AdvancedNoteContentPanel : Panel<br />
{<br />
public AdvancedNoteContentPanel()<br />
{<br />
this.SetStyle( ControlStyles.AllPaintingInWmPaint , true );<br />
this.SetStyle( ControlStyles.OptimizedDoubleBuffer , true );<br />
this.SetStyle( ControlStyles.ResizeRedraw , true );<br />
this.SetStyle( ControlStyles.SupportsTransparentBackColor , true );<br />
this.SetStyle( ControlStyles.UserPaint , true );<br />
<br />
this.BackColor = Color.Transparent;<br />
}<br />
}<br />
<br />
internal class AdvancedNoteDesigner : ControlDesigner<br />
{<br />
public override void Initialize( IComponent component )<br />
{<br />
base.Initialize( component );<br />
<br />
AdvancedNote advancednote = (AdvancedNote)component;<br />
<br />
EnableDesignMode( advancednote.ContentPanelFront , "ContentPanelFront" );<br />
EnableDesignMode( advancednote.ContentPanelBack , "ContentPanelBack" );<br />
}<br />
}<br />
<br />
internal class AdvancedNoteContentPanelDesigner : ControlDesigner<br />
{<br />
public override SelectionRules SelectionRules<br />
{<br />
get<br />
{<br />
SelectionRules selRules = base.SelectionRules;<br />
<br />
selRules = SelectionRules.Locked;<br />
<br />
return selRules;<br />
}<br />
}<br />
}<br />
<br />
|
|
|
|
|
i have used System.Diagnostics.Process.Start("explorer.exe", "/e,/select,c:");
for Opening My Computer. it works. but i want to open My Doc, My Network place also. how it possible?
Thanks.
Sanjit.rajbanshi@wlinktech.com
|
|
|
|
|
You should just be able to put "My Documents" in the arguments list and it should work fine.
So the code is:
System.Diagnostics.Process.Start("explorer.exe", "My Documents");
Hope that helps.
Ben
|
|
|
|
|
You can use the following to get that path:
<br />
string myComputerFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyComputer);<br />
You can then use that information to shell to it ...
|
|
|
|
|
hi
i want to run exe file(s) in buffer,How to do ..thanks(pe,injection,...)
Description :
my exe is Encrypted and exist in CD-drive and when user start my program, it check information of that computer and cd ... then Decrypt that exe in ram and run it from ram (on the fly),without extract on disc. but ho to do ?
|
|
|
|
|
ALL executables that you write run in RAM. You don't need to run from a disk because you can use AutoRun (assuming that it is enabled) to run the application from the CD. If you're looking to see how you can inject a virus/worm onto the client machine then you've come to the wrong place.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I think that he's aiming for is an exe that is encrypted so it can't be decompiled.
After decompiling the app he doesn't want to cache it to disk so Process.Start wont work.
|
|
|
|
|
The principle's still the same. In order to run the application, you would have an encrypted app which you would then fire off using another application. This other application would be responsible for decrypting the application and starting it off. The hint is that you could decrypt the encrypted exe to a stream and then use Assembly.Load to load the executable.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I was thinking that it could be any application, not just a .Net one.
|
|
|
|
|
But, this is the C# forum. If it's not .NET then he's in the wrong forum
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
The way I read it was that he wants to make a C# app that can decrypt and execute any application without writing it to disk.
Of course this is all assumption built on lack of information hehe :P
|
|
|
|
|
Hi,
I'm trying to update a property on an arraylist of visual components on a form, getting the property value to set by calling a method on another object. However, performance is unacceptably slow.
public delegate void VisualComponentUpdateHandler(VisualComponent v, int val);<br />
public void VisualComponentUpdate(VisualComponent v, int val)<br />
{<br />
v.Value = val;<br />
}
and running in a seperate thread:
<br />
VisualComponentUpdateHandler d = new VisualComponentUpdateHandler(VisualComponentUpdate);<br />
int val;<br />
while (true)<br />
{<br />
foreach (VisualComponent v in visualComponentArrayList)<br />
{<br />
val = sourceObject.GetValue(Convert.ToInt32(v.Name));<br />
d.Invoke(v, val)<br />
}<br />
Thread.Sleep(100);<br />
}
I added the Thread.Sleep(100) because without it, the visuals don't seem to update.
I've got anything up to 128 of the visual components to update - they're custom components derived from ProgressBar, displaying a measurement which is obtained from a program running on a seperate machine which passes a new sourceObject every 250ms to the program via .NET remoting (this updating mechanism runs in another thread and doesn't seem to be affected by the slowdown in response which occurs when the property update thread is running).
|
|
|
|
|
Hi,
Might be a stupid questions, but.. Why are you doing d.Invoke(v, val) ? Shouldn't it be v.Invoke(d, new object[]... or something like that? You are attempting to marshall back to the gui thread to update your control right? I think Delegate.Invoke would spawn yet another thread , where it may not be safe to update GUI Controls (which might explain why you need a sleep to make it work)
Bijesh
--------------------------------------------------
|
|
|
|
|
Yes, sorry - I made a typo. It does work; it's just that it renders the GUI too unresponsive. I'm looking for smooth-ish updating on all of the controls and looping through them (even with Thread.Sleep in there) seems to result in massive CPU load and sluggish display. Perhaps it is something to do with the way in which the thread which performs the invoke calls back to the GUI thread obtains the values to set the component properties to (it's not too bad if I just generate some numbers within the updating thread and use those instead).
Back to the drawing board. Thanks.
|
|
|
|
|
Right, got it. Suspicion confirmed. The object I was calling the method on in order to get the values was being blocked by another thread accessing it. Stick the invokes to update the component properties into the same thread and the problem's gone away. Thanks ;P
|
|
|
|
|
Hello fellows. I need your help. I have a Windows.Forms application which makes a connection to a database about 5 - 10 seconds. While I'm trying to connect to the database, an animated control starts an animation . After the connection is made I stop the animation and want to run another function to fill a DataGrid control.
private void OpenConFunction()
{
//... some code
}
private void AfterConnFunction()
{
//... some code to fill DataGrid control
}
private void myButton_Click(object sender, System.EventArgs e)
{
Thread t = new Thread(new ThreadStart(OpenConFunction));
t.Start();
this.AnimatedControl.Start(); //Suppose AnimatedControl
//has two methods one to start animation and a second one to stop it
}
What has to be the code after OpenConFunction returns? I want to invoke the AfterConnFunction and stop the AnimatedControl animation?
|
|
|
|