|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Newbie Question hereHi, just messing around and trying to get my feet wet with VB Express
and some code.... I've got this little program, and I am trying to figure out how to call a function that is setup as a button (without pressing the button, just run the function: Somefunction() If I just put that on a line by itself, it reads back 'declaration expected'...... how do I run Somefunction() like a general call you would have in javascript like <script>somejsfuntion();</script>, except in VB??? -Angie if you have a button called btnClickMe, you can call the click handler
by calling the following line of code: btnClickMe.PerformClick alx***@gmail.com wrote: Show quoteHide quote > Hi, just messing around and trying to get my feet wet with VB Express > and some code.... I've got this little program, and I am trying to > figure out how to call a function that is setup as a button (without > pressing the button, just run the function: > > Somefunction() > > If I just put that on a line by itself, it reads back 'declaration > expected'...... how do I run Somefunction() like a general call you > would have in javascript like <script>somejsfuntion();</script>, except > in VB??? > > -Angie <eric.bur***@usbank.com> wrote in message
news:1164688282.959633.216780@j44g2000cwa.googlegroups.com... The preferred method is to have the button click event call another > if you have a button called btnClickMe, you can call the click handler > by calling the following line of code: > > btnClickMe.PerformClick function, eg: private sub btnClickMe_Click(...) DoClick() End Sub private sub DoClick() 'do stuff here End sub then just call DoClick whenever it is needed. Michael Michael C wrote:
Show quoteHide quote > <eric.bur***@usbank.com> wrote in message Ah, I see :), now so I have this all straight, if I just wanted to run> news:1164688282.959633.216780@j44g2000cwa.googlegroups.com... > > if you have a button called btnClickMe, you can call the click handler > > by calling the following line of code: > > > > btnClickMe.PerformClick > > The preferred method is to have the button click event call another > function, eg: > > private sub btnClickMe_Click(...) > DoClick() > End Sub > > private sub DoClick() > 'do stuff here > End sub > > then just call DoClick whenever it is needed. > > Michael the DoClick() sub, how is it called properly? If there is a sub like DoClick() and I want to run in the first part of the program, how would that be setup? If it's in a form, you could run it in the Form_Load event:
DoClick() Robin S. --------------------------------------------- <alx***@gmail.com> wrote in message Show quoteHide quote news:1164697597.698085.25240@j44g2000cwa.googlegroups.com... > > Michael C wrote: >> <eric.bur***@usbank.com> wrote in message >> news:1164688282.959633.216780@j44g2000cwa.googlegroups.com... >> > if you have a button called btnClickMe, you can call the click handler >> > by calling the following line of code: >> > >> > btnClickMe.PerformClick >> >> The preferred method is to have the button click event call another >> function, eg: >> >> private sub btnClickMe_Click(...) >> DoClick() >> End Sub >> >> private sub DoClick() >> 'do stuff here >> End sub >> >> then just call DoClick whenever it is needed. >> >> Michael > > Ah, I see :), now so I have this all straight, if I just wanted to run > the DoClick() sub, how is it called properly? If there is a sub like > DoClick() and I want to run in the first part of the program, how would > that be setup? > Robin, sorry for my newbieness.... but could you please show which
steps/tabs, where and how you would place that? I'm assuming that you have a form.
With the form open in design mode, double-click on a gray area somewhere. It will bring you to the code-behind, and add a Form_Load event. In this procedure, put the call to the DoClick() method. It will look like this if you click on the right thing. Private Sub myForm_Load(ByVal sender as System.Object, _ ByVal e as System.EventArgs) Handles MyBase.Load DoClick() End Sub The other thing you can do to create this event is open your code-behind window, pull down "Form events" on the left dropdown at the top, and pull down "Load" on the right dropdown at the top. Robin S. ------------------------ <alx***@gmail.com> wrote in message Show quoteHide quote news:1164741663.205746.51700@80g2000cwy.googlegroups.com... > Robin, sorry for my newbieness.... but could you please show which > steps/tabs, where and how you would place that? > By the way, if you're so new to VB.Net that you need help
putting code behind the form, you should race right out and buy Tim Patrick's book, "Start to Finish VB2005". It's a great book, and will really help you get up to speed fast. Robin S. --------------------------------------------- <alx***@gmail.com> wrote in message Show quoteHide quote news:1164741663.205746.51700@80g2000cwy.googlegroups.com... > Robin, sorry for my newbieness.... but could you please show which > steps/tabs, where and how you would place that? > RobinS wrote:
> By the way, if you're so new to VB.Net that you need help I am usually open source, but this project have me diving into all> putting code behind the form, you should race right out and > buy Tim Patrick's book, "Start to Finish VB2005". It's a > great book, and will really help you get up to speed fast. > > Robin S. sorts of new technologies :) Hopefully I can spin-up fast, and get this done. I hope I am not bothering you to ask, but I am modifying a program.... and it seems the .NET VB Express tool hides code and is tricky to understand, but I am figuring it out :) Basically, I want to completely turn off the form or GUI or have it not display at all, and not appear the in the desktray/task manager --- is there a simple way to accomplish all of these tasks? It's a security module, and it's been handed down through generations in this company, has ugly interface.... so I am in a pinch to tie this up tight. Thanks for your time and info :)) Cheers! AmyMC <alx***@gmail.com> wrote in message
news:1164760549.256156.169470@j44g2000cwa.googlegroups.com... You work for a company as a programmer and you're asking how to call a > I am usually open source, but this project have me diving into all > sorts of new technologies :) Hopefully I can spin-up fast, and get > this done. I hope I am not bothering you to ask, but I am modifying a > program.... and it seems the .NET VB Express tool hides code and is > tricky to understand, but I am figuring it out :) Basically, I want to > completely turn off the form or GUI or have it not display at all, and > not appear the in the desktray/task manager --- is there a simple way > to accomplish all of these tasks? It's a security module, and it's > been handed down through generations in this company, has ugly > interface.... so I am in a pinch to tie this up tight. Thanks for your > time and info :)) Cheers! AmyMC function? Michael <alx***@gmail.com> wrote in message
Show quoteHide quote news:1164760549.256156.169470@j44g2000cwa.googlegroups.com... I don't know of a simple way to accomplish that. You> > RobinS wrote: >> By the way, if you're so new to VB.Net that you need help >> putting code behind the form, you should race right out and >> buy Tim Patrick's book, "Start to Finish VB2005". It's a >> great book, and will really help you get up to speed fast. >> >> Robin S. > > I am usually open source, but this project have me diving into all > sorts of new technologies :) Hopefully I can spin-up fast, and get > this done. I hope I am not bothering you to ask, but I am modifying a > program.... and it seems the .NET VB Express tool hides code and is > tricky to understand, but I am figuring it out :) Basically, I want to > completely turn off the form or GUI or have it not display at all, and > not appear the in the desktray/task manager --- is there a simple way > to accomplish all of these tasks? It's a security module, and it's > been handed down through generations in this company, has ugly > interface.... so I am in a pinch to tie this up tight. Thanks for your > time and info :)) Cheers! AmyMC > seem to want something that will run in the background, but not show up in the task manager or the system tray. The only way I know of to do that is to run as a Windows service. I don't have any experience at that, so I can't help you. Anyone else have an idea how Alxasa can accomplish this? Am I right that it has to be a windows service? Robin S. "RobinS" <RobinS@NoSpam.yah.none> wrote in message Creating services in dot net is quite easy. A service is just an exe that news:yYadnaO9tKxag_DYnZ2dnUVZ_uCdnZ2d@comcast.com... > I don't know of a simple way to accomplish that. You > seem to want something that will run in the background, > but not show up in the task manager or the system tray. > The only way I know of to do that is to run as a Windows > service. I don't have any experience at that, so I can't > help you. > > Anyone else have an idea how Alxasa can accomplish this? > Am I right that it has to be a windows service? always runs (if set to autostart) whether users are logged on or not. If this is what the OP wants then a service is appropriate. The taskbar icon and services are not necessarily related. Generally when a service, such as sqlserver, shows a taskbar icon it is a seperate exe that controls the service and can be run or closed independant of the service. Michael Great, a half-way working option for me would be to somehow hide the
GUI, can that be done programatically? :) Thank you for your help earlier, it did clear up my learning curve with VB.NET EXPRESS. Someone in this thread actually asked me a loaded question about my knowledge and position as a programmer? Thanks for not speeding through my emails and responding like a true professional! :) Best regards, A. alx***@gmail.com wrote:
>tricky to understand, but I am figuring it out :) Basically, I want to To prevent it appear in the task-manager's PROCESSES list is something>completely turn off the form or GUI or have it not display at all, and >not appear the in the desktray/task manager --- is there a simple way >to accomplish all of these tasks? I don't know. But preventing it from appearing in the taskbar and the task-managers APPLICATIONS list is a common thing in Windows. In win32 world you do it with the WS_EX_TOOLWINDOW window style. I don't know enough about VB to tell you how it exposes this style. -- Lucian WS_EX_TOOLWINDOW - sounds like a start to what I want to do. Can
anyone expand on this from Lucian? :) Have you tried searching Google and/or MSDN?
Robin S. ------------------------ <alx***@gmail.com> wrote in message Show quoteHide quote news:1164788147.766732.75590@14g2000cws.googlegroups.com... > WS_EX_TOOLWINDOW - sounds like a start to what I want to do. Can > anyone expand on this from Lucian? :) > RobinS wrote:
> Have you tried searching Google and/or MSDN? versions out there, but I will keep looking and hopefully someone on> > Robin S. > ------------------------ > <alx***@gmail.com> wrote in message > news:1164788147.766732.75590@14g2000cws.googlegroups.com... > > WS_EX_TOOLWINDOW - sounds like a start to what I want to do. Can > > anyone expand on this from Lucian? :) > > :))) Not yet, but I did look up my question and didn't see any newbie here knows more than I do! ;) I hope I am smarter this time next year with this dev. app. I am pretty good, but not with the syntax and unique situations with Microsoft products. Alaxasas,
I never do it anymore as told in this thread, so therefore my method. If you want to do a click event than I do. TheClickEvent(me, nothing) The bad thing from the btn.performclick is that the button has to be visible at the moment you do that. Creating extra methods has been for me never been a benefit. Cor <alx***@gmail.com> schreef in bericht Show quoteHide quote news:1164741663.205746.51700@80g2000cwy.googlegroups.com... > Robin, sorry for my newbieness.... but could you please show which > steps/tabs, where and how you would place that? >
Newbie help: How to detect when a worker thread ihas completed normaly
word automation vb.net Arranging window screens on multi-monitor Desktop set refresh rate for an active browser window newbie syntax question: adding event handler for button not working How broad should an interface be? Advice needed. File and Database Search Re: Is VB.NET Stable?? Error on deleting registry value Can't Update Datagridview |
|||||||||||||||||||||||