Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Questions on Forms

Questions on Forms

Scheduled Pinned Locked Moved Visual Basic
databasequestioncsharpsecurity
2 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pete Newman
    wrote on last edited by
    #1

    VB.net 2005 & SQL 2005 Hi all, this is a three part question, as im to lazy to put up three different posts. The project is an application that contains several forms, all accesses from a main form Q1. Once the user is logged on they arrive at the 'main menu'. what id like to try and do is dynamicaly create the options on that form dependant on what they are allowed to do ( this can be obtained via SQL query ) there is a table in the database that holds all the form names, display names and security level What id like to do is display only those 'display names' that the user have the releven security level to, and have the onclick event . to redirect them when the select a form I know there are some real wizz guys out there, but inststead of just throwing code, can some one give an example and explian what its doing so i can at least learn from this Q2. In the old vb6 there was a 'status' panel that i used to stick in info like current user , time etc. the questio is is there a similar control or would it be more prudant to create a custom control and if so how?. Is there a sim[ple way of having this on every form without having to code it every time.... Q3. Form Settings. Currently i have a function that i call from every form that paints the form a certain colour, is there a better way to do this rather than calling a function on each forms 'load' event. once again thanks for all you help ... this site is a great learning tool.. keep up the good work!!

    I really do need help..... all this computer stuff is way over my head !! :confused:

    N 1 Reply Last reply
    0
    • P Pete Newman

      VB.net 2005 & SQL 2005 Hi all, this is a three part question, as im to lazy to put up three different posts. The project is an application that contains several forms, all accesses from a main form Q1. Once the user is logged on they arrive at the 'main menu'. what id like to try and do is dynamicaly create the options on that form dependant on what they are allowed to do ( this can be obtained via SQL query ) there is a table in the database that holds all the form names, display names and security level What id like to do is display only those 'display names' that the user have the releven security level to, and have the onclick event . to redirect them when the select a form I know there are some real wizz guys out there, but inststead of just throwing code, can some one give an example and explian what its doing so i can at least learn from this Q2. In the old vb6 there was a 'status' panel that i used to stick in info like current user , time etc. the questio is is there a similar control or would it be more prudant to create a custom control and if so how?. Is there a sim[ple way of having this on every form without having to code it every time.... Q3. Form Settings. Currently i have a function that i call from every form that paints the form a certain colour, is there a better way to do this rather than calling a function on each forms 'load' event. once again thanks for all you help ... this site is a great learning tool.. keep up the good work!!

      I really do need help..... all this computer stuff is way over my head !! :confused:

      N Offline
      N Offline
      nlarson11
      wrote on last edited by
      #2

      Q1, The easiest way to do this is to put every possible option on the form and through security disable the options that available for the user. If you wanted to hide them instead, you then would just need code to bunch the options together instead of leaving gaps. I did create an application that built the entire form via a database table. there is a lot of code to do it, but it is possible. the "bueaty" of that kind of thing is that you don't have to distribute any changes to the end user. change the database and they immediately get the change the next time they run the app. Q2, There is a status bar in the toolbox of dotnet. If you want to put custom code around, then make a user control that includes the status bar and then you only need to put the user control on each form and then all the code is bound in the control and all forms will use it in the same way. Q3, Look at inheritence. If you make a form that all your forms inherit from then you can make all your forms, have the same events (paint), variables, etc. Example: gradient back ground for every form that inherits from it... Public Class FormBase Inherits System.Windows.Forms.Form Protected Sub FormPaintEvent(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint CType(sender, System.Windows.Forms.Form).BackColor = Nothing Dim formGraphics As System.Drawing.Graphics = e.Graphics Dim gradientBrush As System.Drawing.Drawing2D.LinearGradientBrush gradientBrush = New System.Drawing.Drawing2D.LinearGradientBrush(New System.Drawing.Point(0, 0), _ New System.Drawing.Point(sender.Width, 0), _ Color.FromArgb(221, 236, 254), _ Color.FromArgb(129, 169, 226)) formGraphics.FillRectangle(gradientBrush, sender.ClientRectangle) End Sub End Class Public Class MainMenu Inherits FormBase end Class

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups