Advertisement

Results for "Author: jose fuentes vb mvp"

3_2004-2005 #149118
Simple Multi Thread Example

I've had a few people come to me with how to do multi treading. I've looked around PSC and there are plenty of projects that have multi-threading but none solely for multi-threading. So I did up a simple multi-threading console application that passes data back to the parent thread via events. This is a very simple example and is designed to show how multi-threading can be used. The key to understanding what you would use multi-threading for is to keep one simple thing in mind. All UI (user interfaces) elements must be in the parent thread. You can not have anything that interacts direct with the UI in a seperate thread. For example if you are running a long business process and get an exception, then use a message box to show that exception then nothing will ever be shown to the user. It's in a background thread so the user never see's it. It can also lock the application up since the messagebox is waiting for the user to click ok. What you would do in such an example would be to pass the error message back to the parent thread and let the parent thread display the error message. This is also a good example to show how you could update a progress bar on the parent thread with the process of the thread (like how far along the process has gotten in getting or doing something). Hope this helps. Sometimes you just need to break something down to bare basics to get a good understanding of it. Though this is only one example of how to work with threads, there are many other ways.

3_2004-2005 #149119
Auto insert Guid Datatable

Ok, I ran into a problem, MS out of some odd wisdom didn't do as you would think with the defaultvalue of a data column. you would think it so simple right? In a database such as SQL server you can set the default value to a function, I can do this with a datacolumn too such as. column1.defaultvalue = system.guid.newguid Though this has an issue, if you use this in a grid you will see as you add new rows that the darn guid is the same. It's calling the newguid only once when setting up the table and it's holding that value static for the rest of the life of the datatable\datacolumn. This goes against common knowlege in how MS does things in other area's, such as the before mentioned SQL server using NewID() will get you a new ID each time. Keep in mind that even other funtions like Now() (which returns current date time) won't work, the defaultvalue will always be the same datetime. So I don't have a solution for the default, I have a different solution. Custom datatable and custom datacolumn classes. You will see in my custom column style that there is a new property called (autogenerateguid)if set to true then it will then set each new row with the correct new guid. Though this is all code based, it works for what I need it to do. It also features the use of an un-documented function and class. NewRowFromBuilder Function System.Data.DataRowBuilder Class I've seen other post's that show to use the rowchanging or positionchanged events in order to do the same thing, this example gets to the source of the newrow creation. What would be better is that if you assign a function that MS would call that function each time instead of this lame static method.

4_2005-2006 #161066
Word ADDin

This is a sample of how to make a word add in, This also shows how to interface with the current active document as well, like how to add merge fields or document variables. You also see a simple drag drop.

4_2005-2006 #161067
Auto Complete combo Box

Have you ever wanted an auto complete on your combo box well here it is. I have posted this before but it was my first time and the formating was all messed up. So now it's in a working project.

4_2005-2006 #161068
System Tray Notify Icon

Shows a simple way of how to use the Notify Icon control. Includes a simple timer that changes the icon every second so that it appears to be flashing. Simple code for simple project unlike some of the hairy code I found on PSC for doing the same thing in Dot Net. Also shows how to use the contextmenu along with the Notify Icon control. Please vote.

4_2005-2006 #161069
Auto insert Guid Datatable

Ok, I ran into a problem, MS out of some odd wisdom didn't do as you would think with the defaultvalue of a data column. you would think it so simple right? In a database such as SQL server you can set the default value to a function, I can do this with a datacolumn too such as. column1.defaultvalue = system.guid.newguid Though this has an issue, if you use this in a grid you will see as you add new rows that the darn guid is the same. It's calling the newguid only once when setting up the table and it's holding that value static for the rest of the life of the datatable\datacolumn. This goes against common knowlege in how MS does things in other area's, such as the before mentioned SQL server using NewID() will get you a new ID each time. Keep in mind that even other funtions like Now() (which returns current date time) won't work, the defaultvalue will always be the same datetime. So I don't have a solution for the default, I have a different solution. Custom datatable and custom datacolumn classes. You will see in my custom column style that there is a new property called (autogenerateguid)if set to true then it will then set each new row with the correct new guid. Though this is all code based, it works for what I need it to do. It also features the use of an un-documented function and class. NewRowFromBuilder Function System.Data.DataRowBuilder Class I've seen other post's that show to use the rowchanging or positionchanged events in order to do the same thing, this example gets to the source of the newrow creation. What would be better is that if you assign a function that MS would call that function each time instead of this lame static method.

4_2005-2006 #161070
Simple Multi Thread Example

I've had a few people come to me with how to do multi treading. I've looked around PSC and there are plenty of projects that have multi-threading but none solely for multi-threading. So I did up a simple multi-threading console application that passes data back to the parent thread via events. This is a very simple example and is designed to show how multi-threading can be used. The key to understanding what you would use multi-threading for is to keep one simple thing in mind. All UI (user interfaces) elements must be in the parent thread. You can not have anything that interacts direct with the UI in a seperate thread. For example if you are running a long business process and get an exception, then use a message box to show that exception then nothing will ever be shown to the user. It's in a background thread so the user never see's it. It can also lock the application up since the messagebox is waiting for the user to click ok. What you would do in such an example would be to pass the error message back to the parent thread and let the parent thread display the error message. This is also a good example to show how you could update a progress bar on the parent thread with the process of the thread (like how far along the process has gotten in getting or doing something). Hope this helps. Sometimes you just need to break something down to bare basics to get a good understanding of it. Though this is only one example of how to work with threads, there are many other ways.

4_2005-2006 #161071
Run Code from string

You can now save a whole class in a field of a table and call it and run it. This code will provide the answers of how to turn a string into code that runs. kind of like Scripting your application though much more powerfull

4_2005-2006 #161072
Active Directory Viewer

This project is just to show how to navagate though the active directory in an AD enabled network. You can get any peice of information using these techniques. Active Directory is a very complex animal and as you will see it can go pretty deep and get to be a real mess. Using this technology you can build an even better browser and do all kinds of things.

4_2005-2006 #161073
Stock Tracker

This sample shows how to use some of the HTTP classes to get data from a web site. The code could be used for so many different things, but in this example it is used to get stock info from Yahoo. When you start it up it will get the stock info per spec time given of the stock code entered. Please vote if you find this useful.

4_2005-2006 #161074
Form Designer Basics

This sample shows you how to drag and drop controls onto a form at runtime (thereby creating a runtime form designer) and how to move the controls around as well as resize them.

4_2005-2006 #161075
Control Designer Info

Ok simply put, this is how to get that link to show up in the bottom of the properties window in VS.Net. You know, for example drag a datagrid onto the form and look at it's properties, you will notice an autoformat link at the bottom. Well there is very little info, and guess what, some one came up with a unique name I would never have thought of searching with. They call those links VERBS is that funny or what? So this is a basic example of adding verbs. Though the control designer can be so much more, you can control mouse events and how things look at design-time when laying things out. Check it out, VOTE!!!

4_2005-2006 #161076
Load and unload Assemblies

Ok what this example does is load a DLL that has a form called Form1 (yea I know that isn't creative) and show it to the user. Then you can unload the DLL and it unlocks the DLL. You see when using the createinstance of an assembly it will load that instance into the current appdomain. Once it's loaded and created it then locks the assembly (the dll or exe). You have to completly quite the application in order to delete the DLL. This project allows you to load an assembly and use a class then unload it without ending the entire application. I needed this in order for my dynamicly compiled forms to work, you see if I compiled at runtime a form and viewed it it would lock the DLL, then when I recompiled it I would get a lock error. Even though I closed the form I pulled from the DLL. So this method allows me to view then unload then recomile then view to my hearts desire. Hope this is useful to others. Please Vote I looked everywhere for an answer to this problem and they where slim to none, not one example in VB.net and the ones in C# where really bad most of the time.

4_2005-2006 #161077
Validate Data Grid

This shows how to validate the contents of a datagrid per row, per column. This allows you to check the value of what the user changed\inserted in the desired column. It will show an error icon as well as fill the tool tip. though I have yet to figure out how to make the error icon blink. Also it will show you how to do a summory of errors.

5_2007-2008 #183584
Word ADDin

This is a sample of how to make a word add in, This also shows how to interface with the current active document as well, like how to add merge fields or document variables. You also see a simple drag drop.

5_2007-2008 #183585
Auto Complete combo Box

Have you ever wanted an auto complete on your combo box well here it is. I have posted this before but it was my first time and the formating was all messed up. So now it's in a working project.

5_2007-2008 #183586
System Tray Notify Icon

Shows a simple way of how to use the Notify Icon control. Includes a simple timer that changes the icon every second so that it appears to be flashing. Simple code for simple project unlike some of the hairy code I found on PSC for doing the same thing in Dot Net. Also shows how to use the contextmenu along with the Notify Icon control. Please vote.

5_2007-2008 #183587
Auto insert Guid Datatable

Ok, I ran into a problem, MS out of some odd wisdom didn't do as you would think with the defaultvalue of a data column. you would think it so simple right? In a database such as SQL server you can set the default value to a function, I can do this with a datacolumn too such as. column1.defaultvalue = system.guid.newguid Though this has an issue, if you use this in a grid you will see as you add new rows that the darn guid is the same. It's calling the newguid only once when setting up the table and it's holding that value static for the rest of the life of the datatable\datacolumn. This goes against common knowlege in how MS does things in other area's, such as the before mentioned SQL server using NewID() will get you a new ID each time. Keep in mind that even other funtions like Now() (which returns current date time) won't work, the defaultvalue will always be the same datetime. So I don't have a solution for the default, I have a different solution. Custom datatable and custom datacolumn classes. You will see in my custom column style that there is a new property called (autogenerateguid)if set to true then it will then set each new row with the correct new guid. Though this is all code based, it works for what I need it to do. It also features the use of an un-documented function and class. NewRowFromBuilder Function System.Data.DataRowBuilder Class I've seen other post's that show to use the rowchanging or positionchanged events in order to do the same thing, this example gets to the source of the newrow creation. What would be better is that if you assign a function that MS would call that function each time instead of this lame static method.

5_2007-2008 #183588
Simple Multi Thread Example

I've had a few people come to me with how to do multi treading. I've looked around PSC and there are plenty of projects that have multi-threading but none solely for multi-threading. So I did up a simple multi-threading console application that passes data back to the parent thread via events. This is a very simple example and is designed to show how multi-threading can be used. The key to understanding what you would use multi-threading for is to keep one simple thing in mind. All UI (user interfaces) elements must be in the parent thread. You can not have anything that interacts direct with the UI in a seperate thread. For example if you are running a long business process and get an exception, then use a message box to show that exception then nothing will ever be shown to the user. It's in a background thread so the user never see's it. It can also lock the application up since the messagebox is waiting for the user to click ok. What you would do in such an example would be to pass the error message back to the parent thread and let the parent thread display the error message. This is also a good example to show how you could update a progress bar on the parent thread with the process of the thread (like how far along the process has gotten in getting or doing something). Hope this helps. Sometimes you just need to break something down to bare basics to get a good understanding of it. Though this is only one example of how to work with threads, there are many other ways.

5_2007-2008 #183589
Run Code from string

You can now save a whole class in a field of a table and call it and run it. This code will provide the answers of how to turn a string into code that runs. kind of like Scripting your application though much more powerfull

Languages
Top Categories
Global Discovery