Diamonddrake 397 Master Poster

Scott he's not using the form's graphics object because he needs to draw in front of them so he's drawing to the screen.

back to the OP.
I messed with you example the object not set to an instance of an object error is something trivial happened when moving the code probably, wouldn't worry about that.

I couldn't seem to force an out of memory exception though. just didn't' happen. and I messed with it a lot.

as for all your flicker, you will need to user draw all the user controls that are being refreshed and double buffer them. but that's not your problem at hand.

1 thing you have the using block and still call G.Dispose, not necessary but shouldn't cause a problem.

another when you call refresh in the mouse move it is actually refreshing the entire control and all the child controls it contains. it could be any of the child controls causing the problem when they are painted. as many of these controls appear to be custom drawn you might want to go back and check all of their paint events to see if the leak is there.

I hope this helps. seems you are doing a great job so far.

Diamonddrake 397 Master Poster

I have figured out how to communicate with HID devices well enough to know what features a device supports, but as for finding out how to access data stored in memory on a device. Im at loss. i guess this is something outside the current scope of my sills. I will try this again in the future when I have advanced further.

#Region Shameless Advertising
back to my more enjoyable projects of creating custom drawn controls and my FormsExtention lib. look for that one in the future everyone, I will post a link when its done. Its just a simple and free library that has small easy time saving classes that keeps your main form's code simple and clean. examples are a static "Notifier" class as simple to use as the MessageBox class, just pass a string or two to it and you get a pop up above the tray area, start with windows registry key creator and checker class, save form state to xml class, the hold focus class I have already posted on the forum ect. ect.
#endregion

Diamonddrake 397 Master Poster

you could try a Using statement on the graphics object. but Its clearly disposed in the example I posted. are you sure you didn't omit the g.dispose(); call?

you could try making sure it goes out of scope by using a "using" block example:

[DllImport("User32.dll")]

        public static extern IntPtr GetDC(IntPtr hwnd);

        [DllImport("User32.dll")]

        public static extern void ReleaseDC(IntPtr dc);

        protected override void OnPaint(PaintEventArgs e)
        {


            IntPtr desktopDC = GetDC(IntPtr.Zero);

            Using(Graphics g = Graphics.FromHdc(desktopDC))
{
            SolidBrush b = new SolidBrush(Color.Blue);
            g.FillEllipse(b, 0, 0, 800, 600);

            
}
            ReleaseDC(desktopDC);

        }

that might help, also Im not sure where you are refreshing but I recomend control.Invalidate(true); because it allows windows to decide if its a good time to redraw instead of demanding that it is done now. although refresh might get you a more consistent look. you might try it to see if it increases performance.

best of luck with you Control. tell me how it goes. I always say I am going to do stuff like this but Im lazy, as soon as I figure out how its done, I get bored and do something else.

Diamonddrake 397 Master Poster

you could instantiate it in a static class with a static property that refers to a static variable as mentioned above.

but another method would be just to instantiated it in the first form you need it in then expose it as a property of that form. then you could access it from anywhere either by passing the instance of the form to the other forms, or by using

(Form1)Application.OpenForms["Form1"]._component_list;

There are many ways really. These 2 are just the popular ones. depends on how many forms you are going to have and how often you need to access the data.

Diamonddrake 397 Master Poster

thank you..and i wil try.and cant u show me a sample code of that sms sending program

Well the code on my server is in classic ASP, and won't help you in a desktop application. Then only problem with sending Email is you have to have a SMTP server to make use of, a paid email account from about anywhere will work.

just Google for how to send an email with C# and you will get a million hits. and use ##########@txt.att.net for the to address and it will send as a text message to that #.

Diamonddrake 397 Master Poster

There is an EASY way. all cell phone companies provide a EMAIL to TXT gateway. So if you look it up, example ATT's is the 10 digit phone number followed by @txt.att.net.

Then you just send an email to that address and it sends a text message. Very handy. I use it on my website so visitors can send me text messages.

Diamonddrake 397 Master Poster

A game controller with a blood pressure monitor? I'm lost. As long as you can get an example of source code that sends/receive data then just write your own parsing code and you should be OK, right?

lol, the blood pressure monitor was from a series that allows you to graph your blood pressure over time, just this particular one was a cheaper version and not supported by any particular software. but windows identifies it as HID compliant and gives me Vendor and Program IDs to use and get a device path.

I have code for that. I understand that as well. but the 2 examples I downloaded have problems, the first one has report classes specially written for a particular device that sends data and receives a button click event. while the other example I have has an issue with parsing hex took me a bit to fix that but then it got me an understanding of finding all HID devices and picking the one I want and developing a path to it. which I can get...

But I don't understand how to "get" or "read" data from the device, the device says "USB" on its screen when plugged in, so I know the device knows its connected.

I can't find enough information on creating an "inputreport" for a HID device. It has to do with asking for data but Im baffled. This isn't really for me. My Girlfriend's father wants it, he bought this device …

Diamonddrake 397 Master Poster

I am trying to read data from a bloodpressure meter that has a usb interface that windows recognizes as a HID device. The BloodPressure meter comes with no documentation or software for its USB port. but other meters similar to this one allow you to download data from it about tests. I have downloaded examples in C# 2 of them, the first one is WAY too complicated as its written to control a particular game controller and the other just has errors in it where it parses the data wrong, but I dug through it enough where I can get the "path" to the device.

but I can't seem to figure out how to read data from the device to find out what is can. Does anyone have an suggestions or examples?

I am going to continue to read up and hack around, just though I ask for a little help.

Diamonddrake 397 Master Poster

To answer the OP's question, Keyloggers could be written in any language, although it will require some simple calls to the windows API. If you have any experience in programming I don't see how you could have any problem with such a simple thing. any of the guys here could produce a key logger application in 20 minutes complete with silent install.

But I agree completely. It's not a good idea, and we don't want to help you spy on your girlfriend. Knowing what some one types out of context isn't a good basis of anything anyway.

you want to keep people's kids safe, write an application that kills browser processes as soon as they are started, then runs a new instance of a 2nd program that is a "safe" browser specially written to only allow access to safe domains.

Do anything besides write a privacy destroying application. and yeah, its a password stealing concept, just thing of the log...
Log:
www.bankaccount.comuser@yahoo.com TAB password
that's what will happen about a thousand times a day, a NOONE deserves to know your passwords to ANYTHING.

Diamonddrake 397 Master Poster

That's great code scott, but if you just want to know all the time the condition of the mouse buttons. even when the form is not focused, you will need to implement a low level Mouse hook.

here is a link
http://www.codeproject.com/KB/cs/globalhook.aspx
I recommend version 1, not 2.

if you need this information when your application is the active window I do recommend Scott's solution, but Global to the system, you will need hooks.

best of luck.

Diamonddrake 397 Master Poster

sorry that line is unnecessary. but scratch that code. its works great just you will never see its effect because the desktop invalidates all the other windows and its just immediately erases it.

[DllImport("User32.dll")]

        public static extern IntPtr GetDC(IntPtr hwnd);

        [DllImport("User32.dll")]

        public static extern void ReleaseDC(IntPtr dc);

        protected override void OnPaint(PaintEventArgs e)
        {

            SolidBrush b = new SolidBrush(Color.Blue);


            IntPtr desktopDC = GetDC(IntPtr.Zero);

            Graphics g = Graphics.FromHdc(desktopDC);

            g.FillEllipse(b, 0, 0, 800, 600);

            g.Dispose();

            ReleaseDC(desktopDC);

        }

just paste this into a new form. add
using System.Drawing.Drawing2D;
using System.Runtime.InteropServices;
to the top of the cs file.

you will see its effect. this will get you started down the long and complicated road. Have fun. sorry for the problematic code I posted before.

Diamonddrake 397 Master Poster

you just repeated my link, i think you post it without reading mine :)

lol nope, if you look we posted them at almost the exact same time, yours just went through first ;) too bad you beat me to it.

Diamonddrake 397 Master Poster

you don't use hotkeys for mouse events... for that you will have to use a low level "hook" not too hard.

here is an article that should get you on your way

http://www.codeproject.com/KB/cs/globalhook.aspx

Diamonddrake 397 Master Poster

I didn't know that windows handles controls in containers better than just on the form. Thanks for that knowledge Scott. And thanks for the code snippet, elegant as always.

Kudos.

Diamonddrake 397 Master Poster

I have been part time working on the same application for a year. its a very self serving, on day freeware application for easily accessing applications ect.

I need a container for dynamically create rows of buttons, I am currently using some transparent panels, and changing their visibility when I need to change a "page". when a "page" is full I create a new panel, add it to an object arraylist of panels and have the arrow keys change between the visible panel by looping through all the panels and hiding them, them showing the one that should be shown.

I had an idea that I could just use the tabcontrol and hide its tabs. but I am unsure how well that will work. or maybe there is a much better way to go about this? does the tabcontrol accept a transparent background well?

should I create my own custom user control to act as a panel? seems like a userdrawn control that inherits from UserControl with a transparent background would do this...

I am looking for the best performance, least amount of flicker, and most efficient usage of resources. what was suppose to be a very fast application after EXTENSIVE use of fancy custom drawn everything it seems I am loosing much of that speed.

Diamonddrake 397 Master Poster

That is a pretty good article adatapost, but keep in mind. The problem with "registering" a hot key using those functions, is that there is only 1 windows message for a hotkey that is passed to your application. that is to say if you register 10 different hotkeys, they will all fire the same function. so you must them get event data to determine the pressed key, and handle it accordingly. so its a bit more complicated that that article intails. it also doesn't go into detail about catching the messages. a simple solution would be just to override WndProc and check for the hotkey message, then if so get the key pressed with

Keys key = (Keys)(((int)message.LParam >> 16) & 0xFFFF);
                    KeyModifiers modifier = (KeyModifiers)((int)message.LParam & 0xFFFF);
//where keymodifiers is an enum of modifier keys

then compare it to keys you have set most likely in a custom collection.

A good practice if you wish to put all the code in a separate class would be to create a class that inherits from NativeWindow, it accepts a property of the form handle that it should regulate, then you can override the wndproc method there, cleanly and out of the way. you can also create a custom event args class that contains values for keys and modifiers, and create a custom event called hotkeypressed or something like that, and have it accepts your custom event args. have a class that registers your hotkeys, and creates your native window …

serkan sendur commented: chic +7
Diamonddrake 397 Master Poster

there is a couple ways to do this, the way photoshop does it is drawing to the screen... not the form. here is an example of doing so

using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Runtime.InteropServices;

namespace DrawToScreen
{

#region UnmanagedMethods
internal class UnmanagedMethods
{

[DllImport("user32")]
internal static extern IntPtr GetDC(IntPtr hwnd);

[DllImport("User32.dll")]
internal static extern void ReleaseDC(IntPtr dc);

}
#endregion

#region Actual drawing

public class DrawingToScreen
{
public void PaintRectToScreen()
{
IntPtr deskDC = UnmanagedMethods.GetDC(IntPtr.Zero);

Graphics g = Graphics.FromHdc(deskDC);

g.FillRectangle(new SolidBrush(Color.FromArgb(100, Color.Green)), 0,0, 500, 500);

g.EndContainer(cont);

g.Dispose();

UnmanagedMethods.ReleaseDC(deskDC);
}
}
#endregion
}

Not sure where I got it. Kudos to whoever wrote it.

this method works well, but only if you are sure to draw to the screen over your application only, because the desktop will not be invalidated when you expect, so clearing the image won't always go so hot. Its complicated.

A different... yet equally complicated, but less buggy method would be to create a new form, chromeless, that uses exlayerdwindow to display a slightly transparent image following the mouse. this would be much easier to accomplish the look you want, since the form will support full transparency you could make it look however you wanted, even create the image prorammatically in GDI plus, if you wanted too....

either way, Concepts such as though are very complicated, and the simple things like that are truly the hardest features.

Best of luck.

Diamonddrake 397 Master Poster

there is a C++ library that is open source called "aspell". you may be able to wrap it in .net get all its functionality without the headache.

but as far as I understand, on the space, comma, semicolon and period key presses, you could split the text in the box getting its last word, compare it to a dictionary and get if its spelled right. in which case you could change its color or something in a rich text box. as far as the suggestions, that could be based on a regular expression algorithm, but idk what the standard method is.

It wold be nice if the next version of .net offered a ritchtextbox control with a spellcheck feature build in.

Diamonddrake 397 Master Poster

Do you have Microsoft office installed on your computer?

ddanbe commented: Indeed, not everyone has! +8
Diamonddrake 397 Master Poster

search for drawing in C# using GDI+ The idea is usually just to create a custom user control, what has a user paint property set to true. override its paint event then using the graphics object supplied by the event to draw what you need. just simple circles and such you can use the drawing methods of the graphics object. But if the pattern you are trying to draw is more complicated. then you will need to create graphics paths.

Its all pretty simple. This will get you started in a jiffy

http://www.devsource.com/c/a/Languages/Getting-Started-with-GDI-in-C-Applications/

Diamonddrake 397 Master Poster

I just read some text about using a toolstripdropdown class for this purpose. but how I have been trying is on a button click event i create my popup form, show it, use point to screen to set its location, then in the constructor of the popup form I used capture=true, and give it an onmousedown event and just use this.Close(); the form then contains some custom drawn buttons that simply just change color when moused over using the mouse enter and leave events.

but when the capture property is set to true, the mouse events don't fire the custom buttons. but without that property set to true. the form doesn't close when you click off of the form like most people assume a context or popup menu would...

ideas?

Diamonddrake 397 Master Poster

nah, its a windows forms application.

Diamonddrake 397 Master Poster

I have created a custom drawn search bar for an app i am working on. see picture: http://www.diamonddrake.com/test/imgs/mySearch.JPG

when the user clicks on the google icon to the left. a little borderless form opens with custom drawn buttons that have icons for other search engines, you get the drift. only I am having an issue with dismissing it. I would like it to act like a standard context menu. so when I click on anything anywhere else, it will close. i tried setting the form's mouse down event to close it, and its captured property to true, this works... only the buttons on the form don't get their mouse enter events.

So I ask, what is the standard procedure for this kind of thing? and if their isn't one, what is a good solution?

Diamonddrake 397 Master Poster

if you wanted to create an application that launches the others, and allows you to switch around between the windows, yes you can. But integrate them directly into the same application... no sir, sorry you cannot.

you could create the illusion of it. by storing the applications inside of a c# app as a resource, and extracting them, running them, then deleting them... but that would be pointless and a general bad idea.

but if your apps use DLLs, you could integrate those into your C# application. often most of the hard work in an application is done inside of an external class stored in a library, and the actual exe is just a gui and wrapper, in that case, it's doable, but as standalone apps. nah. not gonna happen.

Diamonddrake 397 Master Poster

go fa ya app and ma it a roole and pu it in ya a...

ROFL!!!

to the OP.
there is a million ways, easiest would be to create 2 user settings that is of string type, and on successful log in, save them, then load then with the app and check on the on key up event, have it check the username text box and if it matches the saved one, have it load the password...

same could be applied to a database for remembering multiple usernames and passwords. if you wanted too...

Diamonddrake 397 Master Poster

A couple of months ago I had wanted to keep a form active as long as it was visible, I couldn't find any help with this, a couple of forums led me into the dirt, as everything they suggested failed. I decided against the feature, but not before I found a way to do it.

seems there must be a delay between calling activate and deactivate on a form in order for it to work. and set foreground window no longer works the way it sounds. some suggested a timer to constantly activate the form, and that was buggy. but I found a way, by creating a separate class that activates the form after an interval from when the form was deactivated... works great,

I am not saying that it is ever a good idea to force a form to keep focus, but everything has it purpose. So here for your pleasure is an class from my forms extensions library, HoldFocus.

simply instantiate it,passing to it the form that should keep focus, keep in mind, this is annoying, but helpful in kiosk apps and the like, this class could easily be extended to hold a property that enables/disables the holding of focus, but that's another story.

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace DDFormsExtentions
{
    class holdFocus
    {
        System.Windows.Forms.Form form;
        Timer t;

       public holdFocus(System.Windows.Forms.Form f)
        {
            form = f;

            form.TopMost = true;

            t = new Timer();
            t.Interval = 10;
            t.Tick +=new EventHandler(t_Tick);

           form.Activated +=new …
Diamonddrake 397 Master Poster

First create some variables to hold your sound objects, you want them to have a full scope so create them directly in the class.

protected IrrKlang.ISoundEngine irrKlangEngine;
		protected IrrKlang.ISound currentlyPlayingSound;

then in the form's constructor initialize the the sound engine.

irrKlangEngine = new IrrKlang.ISoundEngine();

then in the load event or a button or whaver you want it to start use

currentlyPlayingSound = irrKlangEngine.Play2D(filenameTextBox.Text, true);

            currentlyPlayingSound.PlayPosition = //how ever far you want it to start;

just play with the properties of the sound object to manipulate its volume, play position, play length. ect. ect. ect.

Diamonddrake 397 Master Poster

http://www.moddb.com/engines/irrlicht-engine/downloads/irrklang

Download this free player engine for .net Its not big, comes will a million examples, plays about anything, anyway you want it. even allows for easy 3d sound too. Check it out!

Diamonddrake 397 Master Poster

file systems manage drives access, not programs or operating systems. you can modify the filing system's access rights to users by using applications to modify the security permissions in the filing system, but It wasn't designed to be modified frequently like that. you could end up with a completely inaccessible drive.

There are much better ways to go about it. I agree with Scott and Dan. not only can you not. If you do find a way, you most certainly shouldn't.

Diamonddrake 397 Master Poster

Unsafe code has its advantages, there are some instances you will find that you just can't get the performance you desire without using pointers. I have had that trouble twice. Both times were related to images.

Diamonddrake 397 Master Poster

Sharp is great for doing anything quickly. Its not the most powerful, and its not the fastest. But it gets the job done.

also, there is a framework called XNA. it is for writing 3d games for windows and the XBOX360. XNA It is exclusively C#.

It is fairly easy to learn, straightforward, and object oriented. It has THICK requirements, the .net framework, which has to be the right version for your app to run. and you get no warning if its not. It just crashes. So almost all C# apps are installed using MSI, which checks for the required framework. the code doesn't compile to native, and runs through the CLR, you don't have direct memory access, all this is what is referred to as "managed". It has its drawbacks, but its so easy to learn compared to C++.

you certainly can't create operating systems with it, nor dos, or any outside of windows applications period. there is a framework hack for Linux, but its not a guaranteed thing. If you are familiar with programming, go ahead and pick it up. Like I Said its pretty easy to learn.

Diamonddrake 397 Master Poster

Simple, create a event handler for each form's on resize event. Then add this code to the event hander.

if (this.WindowState == FormWindowState.Minimized)
            {
                foreach (Form f in Application.OpenForms)
                {
                    f.WindowState = FormWindowState.Minimized;
                }
            }
            else if(this.WindowState == FormWindowState.Normal)
            {
                foreach (Form f in Application.OpenForms)
                {
                    f.WindowState = FormWindowState.Normal;
                }
            }

and if any of your forms support maximimization you will want to put an else in there for that. This simple loops through all the open forms in the app and sets them to the same state as the one that was minimized or restored.

Happy coding.

Diamonddrake 397 Master Poster

A good start would be something you need. I created a slew of tools that would help me in my every day endeavors, examples, a notepad clone tailored to my everyday needs including a dozen text sorting functions, a url escape sequence translator to help me download things from the net, a custom download manager for downloading any type of file from a path, a simple system tray mp3 player to keep my workspace clean, an xml based todo list app that logs dates that I complete certain objectives and shows me a productivity report when I need to know how well I am spending my time.

There is no standard for a moderate difficulty project. Some things an ambitious project would include would be:

some custom drawn controls.
using custom event handlers.
saving data in XML or a DB.
networking support.
multi-threading.
and if really ambitious skin support, and docking to screen edges.

you shouldn't write a needless program. There is too much crap ware already out there, Thats why I learned to program. So I could create software I needed instead of spending hours searching for software that won't really do what I need.

So ask yourself as a computer enthusiast, what do you need a program to do?

Diamonddrake 397 Master Poster

Are you trying to create a custom screensaver manager? Because windows handles the wait X amount of time of idle before starting a screensaver, that's all part of the operating system. all you do is create your program and change its .exe extention to .scr and put it in the system32 directory. windows screensaver dialog will automatically find it and put it in the list of screen savers in the Display properties of the system.

There is much more to it. I actually created a custom screen saver from scratch in C#, works amazingly well, even the preview int he display dialog works, Its all based on command line args, do some studding up. all the information is there on the net. If I did it, anyone can. I have no training, no college, just a High School Diploma, and the internet.

Diamonddrake 397 Master Poster

well yeah, that too. glad I could help.
furthermore, writing code to mimic the resizable from borders isn't that difficult anyhow. you could easily use conditions of mouse position in conjunction with the SetBounds method in windows.forms namespace. or an even lazier way you could create user controls for an app, use them to draw custom borders on, in conjunction to using them to put resizing code on.
But its all in how far you feel like going.

Diamonddrake 397 Master Poster

of course, set the formborderstyle to siziabletoolwidow. then simply change the controlbox property to false, then you get a titlebarless window. still the border, but I believe you can clip the display region by the client rectangle to get rid of the border. but as for the code involved, I'm not quite sure.

Diamonddrake 397 Master Poster

Creating images and loading them you will notice you will either have to include the images as resources, or as files along with your program. Its a lot of trouble, you won't get good results. especially when the control is resized. or if you have non rectangular controls.

Drawing the control by overriding the onPaint method of a control and using gdi is the best way to go about it, as the examples shown before from sknake and dan.

Diamonddrake 397 Master Poster

I'm not sure what this Area.Room1 object is, but that is most likey the problem. try changing it to a hard coded string and you will see that it works fine.

The problem most likely is that this object is not initialized with a value at the time the onload event is called. the onload event is called immediately after the constructor, as soon as it has finished creating all the controls and objects inside the constructor. so unless this area.room1 object is created inside the constructor, or static, then its going to fail.

Diamonddrake 397 Master Poster

The load event has nothing to do with how the form is show, or even if it is shown at all. when the form is created as an object, done in your first line of code, the form "loads" and its load event is called then. It of course cannot be shown before it is loaded.

there must be some other problem, because you can easily change the name property of a label in a forms load event.

if you could post your code from "form 2" where the load event takes place. we could help further.

Diamonddrake 397 Master Poster

Thanks for the reply. Im not familiar with trac, I shall look into that.

Version control is new to me, I am a self-taught programmer and I had never taken though of it. I just though everyone made tons of copies manually of their code. I'm one of those last one to know everything kind of guys. but I get along alright.

again, I appreciate it.

Diamonddrake 397 Master Poster

What are you guys using for version control in conjunction to Visual Studio?

I am currently using Tortoise Bazaar, and it shipped broken, had to edit a file just to get it to run. Other wise its effective, only it is a console interface. and although I know many that use console apps, I personally don't like to worry with typing everything. I would prefer some buttons and some icons. i type enough when I am codding, thank you auto-complete!

any suggestions on good version control apps?

Diamonddrake 397 Master Poster

My friend swears by it using sql server and php. he told me I could use a embeddable version of SQLite, and get an easy ORM library for it. I will look into that.

Thanks Ramy

Diamonddrake 397 Master Poster

I think I got the concept, I just can't seem to put it into action. I would like to create a intermediate layer for an access database for use with a simple desktop application. Its just not going well. maybe i will just stick with SQL.

Diamonddrake 397 Master Poster

Alright. I have read those pages in full. The First page shows how to use the designer to map an sql server 2000 database automatically to an object. and that's pretty simple, but what about say a MS Access database, something more modular like for a desk top application? The 2nd page shows describes using javascript to interact with an XML file for setting for some 3rd party tool called Hibernate.

Am I to understand that in order to use ORM I need some outsides tools? that the .net framework can't naively do this through code?

This was described to me in a way that had me picturing an object that was inheritable, that when you created a new object that inherited from it, it passed back to the base a datasource type like oleDBConnection and a connection string for it. this new object would be a collection of all the objects in the datebase, and would support methods to easily update, remove, save, refresh ect. From the database without writing any sql execution codes, or having to adapt from the return information to use it.

it would simply be an object you would define with properties of each column. change something a property in on of the objects, and call its update method, and the database it updated.

am I not getting this right? how is this done?

Diamonddrake 397 Master Poster

A friend of mine programs in php and ruby. But we were talking about our projects and I brought up how I don't do much database type applications because I find it boring. And we somehow got on the subject of SQL.

This is more of a discussion question, as I am not looking for the solution to any definitive problem.

Im new to the whole LINQ concept. I never have used it, but I have seen it used, and It seems to be a kinda of "middle man" between objects and databases or XML files. And someone please correct me if Im wrong. But it seems to be a way of using queries to choose properties from objects in a collection as if there were in a database.

That seems a bit opposite of what I am looking for. I was introduced a concept, that there could be an object. that could be mapped to a database. And it would be as simple as inheriting a new class from this object, specifying its database path and type, Then choosing from it a table, the inherited object would then have properties of the same name as the columns in the table and could be manipulated easily, then calling an inherited method like .save(); would simply update your database, with no direct SQL strings having to ever be created , adapted, or executed.

anyone know of this and in a feeling to share? or can someone suggest …

Diamonddrake 397 Master Poster

I don't think the OP was looking for a link to a product. But its a neat product I will admit. There are very few ways this can be done, you can custom draw your controls to the screen, which is complicated and can get very messy, but since its not drawn on the form. It can be whatever Opacity you want.

here's where the multiple forms concept comes to play. its not really that messy. its not that hard to do, It often yields great results. And using a "Form" overlay for your main form can get the job done.

it doesn't actually have to be a "Form" but just a separate "window" windows OS treats everything as a window, you just need to create another window, with its own handle, that can be modified separately. and the easiest way to do this is with a new form.

so. I suggest 2 methodologies for this.

1. if you don't intend to need to reuse, or use multiple controls with this feature, then just create a new form, with a formborderstyle of none, add the control you need on it. give it a transparent background. and create a public property that exposes the control.

Then in your original form, create an instance of the new form, set it where it needs to be, just as if it were just a control, then use and set the properties and methods of the control property you created …

Diamonddrake 397 Master Poster

what is this webin object that is used to load the html? It seems to be already created before the function that calls the print. you could try creating it loading, printing, then disposing that object. Its likely that its still treating the file like its still in use even though you call its own method that seems to navigate away.

Just a though, if you haven't tried that yet.

Diamonddrake 397 Master Poster

yeah wow, that's an incredibly complicated thing to do. Its only purpose is to sort large amounts of data but only use minimal system resources and is typically much slower. Its actually a lot of work.

The real question here, is do you really need it bad enough to put in that much work?

Diamonddrake 397 Master Poster

The code ramy posted was sound. It had a little left to chance, but I don't see how anyone could have a problem with it.

I have included an example project, just compile it and click the button, then go back and read the code.

all credit to this code goes to ramy, I just copy and pasted it in, then modified it slightly to be more obvious in what was what.

Ramy Mahrous commented: Thanks :) +7
Diamonddrake 397 Master Poster
private void safetipsbtn_Click(object sender, EventArgs e)
        {
            mainpage mp = new mainpage();
            this.AddOwnedForm(mp);
            
            safetips safe = new safetips([B]this[/B]);
            safe.Show();
            internetsitebtn.Enabled = false;
            howtousebtn.Enabled = false;
            adminpanelbtn.Enabled = false;
        }

then modify the safetips constructor

Form MP;//hold main form instance
public safetips(Form MMP)//this is the safetips constructor
{
MP = MMP;
}

now you can reference any public member on the first form from the safetips form by useing the form instance variable "MP" we just created. example.

MP.[I]buttoncontrol[/I].Enabled == True;

do that for all your buttons in the on closing even and you will get your desired effect.

Sorry its so concise. its late and I am tired of typing. Good luck.
Happy coding.