cdoverlaw Posted October 11, 2003 Posted October 11, 2003 Hi, i started off in Visual Basic 6 in september at college and i have progressed fast and have moved onto visual basic .net, anyway i want some sample code to look at which changes the opacity of the program. I want it to use a combo box with different default opacity values and the option to enter other value, i then want the user to then click apply, I know i may sound thick asking this question but i am only new so dont be to harsh on me Jonathan Quote
*Experts* Volte Posted October 11, 2003 *Experts* Posted October 11, 2003 Set the Opacity property of the form to do it. Only works in Windows 2000 and up. Quote
cdoverlaw Posted October 11, 2003 Author Posted October 11, 2003 I know that but i cant get my subroutine to work so can someone send me a project to jon@rawserve.com which does what i want it to so that i can look at the code and see where i am going wrong Jonathan Quote
*Experts* Volte Posted October 11, 2003 *Experts* Posted October 11, 2003 You need to make sure the value is between 0 and 1. For example, 0.5 is 50% opacity. Quote
cdoverlaw Posted October 11, 2003 Author Posted October 11, 2003 OK here is my code for the subroutine i have at the moment Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Form1.Opacity = 0.5 End Sub I get the build task error of C:\Documents and Settings\Jonathan.N-FORCE\My Documents\Visual Studio Projects\Opacity\Form1.vb(59): Reference to a non-shared member requires an object reference. Quote
*Experts* Volte Posted October 11, 2003 *Experts* Posted October 11, 2003 You can't call a form like that. You need to reference the class instance, not the class itself. Do it like this:Me.Opacity = 0.5 Quote
cdoverlaw Posted October 11, 2003 Author Posted October 11, 2003 I dont understand, please can you explain what i need to do, i am only new to visual basic.net and am a fast learner, Quote
*Experts* Volte Posted October 11, 2003 *Experts* Posted October 11, 2003 I just told you. UseMe.Opacity = 0.5You had the right idea before, you just weren't referencing the form correctly. Quote
cdoverlaw Posted October 11, 2003 Author Posted October 11, 2003 cool, thanks, also how do i execute another program from within a visual basic program Quote
*Experts* mutant Posted October 11, 2003 *Experts* Posted October 11, 2003 System.Diagnostics.Process.Start("path to the exe") The process class will let you start and control processes. If you want more options then create a new Process object instead of using the shared method to start the app. :) Quote
cdoverlaw Posted October 11, 2003 Author Posted October 11, 2003 also how how do i make a trackbar control the opacity, what code is required, (i have never used a trackbar before) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.