Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VC++ Help Code

Status
Not open for further replies.

d0s

Programmer
Apr 15, 2004
48
US
Ok is it just me or does visual studio's code when u search a topic not fully coded? im probably not wording this right but i'll try to explain. I was just doing some searches through Visual Studio's search engine with Visual C++ filtered. I came across setting the opacity of your program from the interface and programmatically. I decided to test to code out. I created a new Windows Form application. Added some buttons that would give the program a different opacity, double clicked each button(to bring up the code window), and entered this code straight from the help file

Code:
public:
   void MakeSeeThru()
   {
      frmTransparentForm->Opacity = 0.83;
   }

I changed the value of the opacity so it wouldn't be just .83. When i went to compile it, i get ALOT of errors. Don't know why its giving me errors when its code straight from the help file. I decided to try another one out. I found a FAQ on microsofts MSDN section asking
How do I create a form with resizing borders and no title bar?
So i loaded a new Windows Form project and double clicked on the form itself to bring up the code window with Form_load and thought this would be the place to put it. So i entered the code straight from the help file
Code:
form1.Text = string.Empty; 
form1.ControlBox = false;
When i compiled i got 16 errors..So after this long rant my question is, am i doing something wrong? Did i install wrong, even tho i just followed the steps on installing?? Did i not include something i need to include in VC++ directories? im just completely confused on this so any advice would be great. Thanks
 
You said you changed the opacity value so it wouldn't be just .83, what do you mean by this? Did you try using the exact code from the example without any changes?

What kind of errors are you getting?
 
yep im using that exact code..i was just meaning i wasn't using the .83 opacity i was using like. .75 and .25 ect.. here is the code within the function straight from form1.h
Code:
private: System::Void button4_Click(System::Object *  sender, System::EventArgs *  e)
			 {
public:
   void MakeSeeThru()
   {
      frmTransparentForm->Opacity = 0.75;
   }
and here are the errors im getting.
Form1.h(71): error C2065: 'frmTransparentForm' : undeclared identifier
Form1.h(70): error C2143: syntax error : missing ';' before '{'
Form1.h(80): error C2143: syntax error : missing ';' before '{'
Form1.h(90): error C2143: syntax error : missing ';' before '{'
Form1.h(100): error C2143: syntax error : missing ';' before '{'
Form1.h(68): error C2143: syntax error : missing ';' before 'public'
Form1.h(78): error C2143: syntax error : missing ';' before 'public'
Form1.h(88): error C2143: syntax error : missing ';' before 'public'
Form1.h(98): error C2143: syntax error : missing ';' before 'public'
Form1.h(71): error C2227: left of '->Opacity' must point to class/struct/union
Form1.h(81): error C2227: left of '->Opacity' must point to class/struct/union
Form1.h(91): error C2227: left of '->Opacity' must point to class/struct/union
Form1.h(101): error C2227: left of '->Opacity' must point to class/struct/union
Form1.h(81): error C3861: 'frmTransparentForm': identifier not found, even with argument-dependent lookup
Form1.h(91): error C3861: 'frmTransparentForm': identifier not found, even with argument-dependent lookup
Form1.h(101): error C3861: 'frmTransparentForm': identifier not found, even with argument-dependent lookup
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top