|
I understand, but can't offer anything to you, sorry.
|
|
|
|
|
Hiho!
I would like to know how (if at all possible) I can prevent an alert() box to show up.
I am using the AxWebBrowser to display an HTML. Works great, but if there is a javascript in the HTML showing an alert(), the application is waiting for the user to click on that alert. I don't want to disable the javascript, just the alert box.
Thx,
GhoulLord
|
|
|
|
|
|
Thank you for the information, but I have problems to find what I am looking for.
I had a look at 05_CIF_Browsing.DOC. But unfortunately I found nothing that would solve my problem. Could you please give me a more precise hint where to look?
Thx,
GhoulLord
|
|
|
|
|
Not really, sorry - I thought it was outlined in that document.
Essentailly, this is part of the Local Machine Lockdown stuffs from XP SP2. If you search the MSDN for that phrase "Local Machine Lockdown", you should find some relevant
information ...
|
|
|
|
|
Hi,
I'm trying to create a MDI window which has a SplitContainer, on the left SplitterPanel a treeview and when a node is double clicked a Form should open in the right SplitterPanel. I'm trying to make the Form a child of the MDI Window and also display it within the right SplitterPanel. The problem is that, when I double click the TreeView node, the Form which is added to the right Splitter Panel is not added as a child of the MDI and it also does not have focus. I can move the Form window and access its controls, but it does not retain focus. This is the code I used to add the Form ( done within the Constructor)
// g_mdiform is a instance of the MDI window
// g_mdiform.WorkingPanel returns the right SplitterPanel
this.MdiParent = g_mdiform;
g_mdiform.WorkingPanel.Controls.Add(this);
I tried the following code within the Mdi Window class as a test.
Form frm = new Form();
frm.SetBounds(100, 20, 100, 100);
frm.MdiParent = this;
splMDIPane.Panel2.Controls.Add(frm);
frm.Show();
The above problem still exists.... If anyone knows how I can resolve this, please let me know...
Thanks
Mahesh
|
|
|
|
|
Hi, Mahesh.
If you want to create a classic MDI application then you shouldn't use SplitterPanel in your main form. You just need to follow next steps:
1. Set MainForm.IsMdiContainer = true.
2. Add a TreeView to the MainForm and set treeView.Dock = Left.
3. Add a Splitter to the MainForm and set splitter.Dock = Left.
4. When you need to create MDI child use this:
ChildForm child = new ChildForm();
child.MdiParent = this;
child.Show();
|
|
|
|
|
Hi Andrew,
Thanks
I was trying to create a Tree navigator that could be hidden or moved out of the way if required... I'm still new to C# and doing a project for my degree. I was trying to get a Navigator which is Dockable and Floatable. I was trying to use a SplitContainer so that the Navigator could be hidden when not required. I found a third party library (from a code project article) called Magic Library, which provides a great docking manager... It seems to provide the functionality that I require. I'm trying to use that for the Tree Navigator.
thanks again for ur help
Mahesh
|
|
|
|
|
hi i want to know the different ways of interfacing with MS Office.
Any and all kind of interfacing - whether it is through CSV files, object intereaction, anything else
please do suggest me or give me some inputs....
|
|
|
|
|
|
Check out the Visual Studio Tools for Office (VSTO). I've automated an excel spreadsheet to retrieve information from a database and perform automatic calculations/autoformat/etc. Eric Carter and Eric Lippert wrote a great book on it in the Microsoft .NET development series.
|
|
|
|
|
You can also use ODBC connections against Excel files or third party software like Aspose as well.
|
|
|
|
|
As I study more C# and work with it more at my job, I have read and heard the term "Sink" what exactly does that mean? I have heard it in reference with events and delegates but do not have a clear understanding of its meaning. Any help would be great appreciated.
|
|
|
|
|
I suppose. So if you have an event the listener would be the sink.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Hi
I would like to know what happens when you hit the Help Button (the question mark) and then click a control on the form. How does it show the HelpString? I would like to do that when i hit, for example, Ctrl+F1.
Thanks
|
|
|
|
|
|
Hi there,
I've got an Image object which I'd like to turn into a greyscaled image without big fuzz. I've been searching the board and the articles, but found only a couple of pretty complicated snippets. All of them required the Image to be turned into a Bitmap and manipulated the individual pixels.
Has anyone got a snippet which can work directly with the Image ? Or, if not, can anyone tell me please how to convert an Image into a Bitmap and vice versa?
Quality of the image is not an issue. Purpose of the code is just to display a lightweight preview of the image without eating up tons of resources.
Thanks a lot in advance.
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
private void Form1_Load(object sender, System.EventArgs e)<br />
{<br />
OpenFileDialog dlg = new OpenFileDialog();<br />
dlg.Filter="Image files (*.BMP, *.JPG, *.GIF)|*.bmp;*.jpg;*.gif";<br />
if(dlg.ShowDialog()==DialogResult.OK)<br />
{<br />
Image img = Image.FromFile(dlg.FileName);<br />
Bitmap bm = new Bitmap(img.Width,img.Height);<br />
Graphics g = Graphics.FromImage(bm);<br />
<br />
<br />
ColorMatrix cm = new ColorMatrix(new float[][]{ new float[]{0.5f,0.5f,0.5f,0,0},<br />
new float[]{0.5f,0.5f,0.5f,0,0},<br />
new float[]{0.5f,0.5f,0.5f,0,0},<br />
new float[]{0,0,0,1,0,0},<br />
new float[]{0,0,0,0,1,0},<br />
new float[]{0,0,0,0,0,1}});<br />
<br />
<br />
<br />
ImageAttributes ia = new ImageAttributes();<br />
ia.SetColorMatrix(cm);<br />
g.DrawImage(img,new Rectangle(0,0,img.Width,img.Height),0,0,img.Width,img.Height,GraphicsUnit.Pixel,ia);<br />
g.Dispose();<br />
this.BackgroundImage=bm;<br />
}
I got this from here: http://www.bobpowell.net/grayscale.htm[^]
Any good?
|
|
|
|
|
Hi there,
thanks a ton. Seems to be just the perfect code. Unfortunately do I not understand even a tiny bit of what is happening there (never ever done GDI programming, ever!). Do you have an idea on how to convert it back into an Image object? I somewhat required an Image as in- as well as output.
Sure, I could look it all up and learn the ropes... But sorry, I'm probably never ever doing GDI again, so please understand that I'm just out for a solution.
Anyway, thanks again!
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
So no need to convert. (Check the help or RTFM)
In memory graphics operations are performed on uncompressed bitmaps (always?)
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
How's this?
private void Form1_Load(object sender, System.EventArgs e)<br />
{<br />
OpenFileDialog dlg = new OpenFileDialog();<br />
dlg.Filter="Image files (*.BMP, *.JPG, *.GIF)|*.bmp;*.jpg;*.gif";<br />
if(dlg.ShowDialog()==DialogResult.OK)<br />
{<br />
Image colourImage = Image.FromFile(dlg.FileName);<br />
Image greyscaleImage = GreyscaleImage(colourImage);<br />
<br />
<br />
colourImage.Dispose();<br />
greyscaleImage.Dispose();<br />
}<br />
}<br />
<br />
private Image GreyscaleImage(Image img)<br />
{<br />
Bitmap bm = new Bitmap(img.Width, img.Height);<br />
Graphics g = Graphics.FromImage(bm);<br />
<br />
ColorMatrix cm = new ColorMatrix(new float[][]{ new float[]{0.5f,0.5f,0.5f,0,0},<br />
new float[]{0.5f,0.5f,0.5f,0,0},<br />
new float[]{0.5f,0.5f,0.5f,0,0},<br />
new float[]{0,0,0,1,0,0},<br />
new float[]{0,0,0,0,1,0},<br />
new float[]{0,0,0,0,0,1}});<br />
<br />
ImageAttributes ia = new ImageAttributes();<br />
ia.SetColorMatrix(cm);<br />
g.DrawImage(img,new Rectangle(0,0,img.Width,img.Height),0,0,img.Width,img.Height,GraphicsUnit.Pixel,ia);<br />
g.Dispose();<br />
<br />
return (Image)bm;<br />
}
|
|
|
|
|
Yesssss, thanks. You made my day...
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
But if you don't downsize the image or downgrade it in memory you will occupy the exact same resources. I believe all of the .NET and GDI+ render operations are 32bit (even on low bit images). Shrink the size of the bitmap for the display and you will get the desired resource reduction without all of the code.
BTW, image processing ops in GDI+ seem to be a lot slower the display processing from my rather limited testing.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Hi,
Thanks in advance. I have an application which loads the database tables with five different site codes. In future the number of site codes may increase. For each site code 14 files are sent from another server to our server.
I have to write an application which checks for all the files to arrive and converts it into UTF-8 format and then calls the PL/SQL package and this should run parallely.
So I thought of using Multithreading with one thread for each of the site codes with site code as parameter.
Here is the problem I face. For instance, I have a flag which would be set to "No" if the files are missing and "Yes" if the files exist. In multithreading if I have to preserve the variable I have to block the variable from the other threads using it. Suppose for the site code where files arrival get delayed for 5-6 hrs or for some reason and it's thread blocks the variable then the other threads has to wait for this and this is not what I want. And I have set a lot many flags for in this application. Is Multithreading useful in this scenario? Please let me know your suggestions.
Thanks & Regards,
Das.
|
|
|
|
|
Often the primary difficulty in multi-threaded apps is the logical layout. If you have many threads performing the same operation on disperate data sets you should not have one variable shared between them that controls them all. Using good OO techniques you can have one no flag across many different instances.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|