Introduction[INDENT]Since this is my first thread in VB.NET forum(most of the time, I was in C/C++ forum), I want to share something that you might find it useful with your school project or with your works.Button is already a MUST-HAVE element in every program (I couldn't imagine program without a single button would function). Because it is everywhere, its appearance affects your form's appearance greatly. Some people might not care about how their software looks, but to me, it is a very important aspect for my software.
NOTE: I am pretty new to VB.NET myself. If there is any mistake, please correct me.
[/INDENT]
Step 1: Creating UserControl and Essential Properties[INDENT]Creating UserControl into your project. Then imports the following:
Imports System.ComponentModel
Imports System.Windows.Forms
[code]....
Because UserControl already has BackColor and ForeColor properties, you only need to construct Text and BorderColor properties
Private _BorderColor As Color '' Button Border Color
Public Property BorderColor() As Color
Get
The login box is the first box to appear, but after I successfully enter the right username/pass combo it goes to the next form, but the login form stays open as well? I've tried doing this:
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click Dim username As String Dim password As String
[code]....
However, after I click Login it closes down both windows. I've also tried LoginForm.Close() but that comes up with an error.
I'm making a builder for a simple ftp client, but i have a problem.I have readed a tut about a builder with a stub, thats done but i only can fill in 1 form, but how can i make that my builder fills 2 forms in the client?
My code in the stub is:
Dim options(), text1 As String Const FileSplit = "@vorfin@" Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load FileOpen(1, Application.ExecutablePath, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared)
I'm making a simple HEX Editor with VB 2010. As a result I am trying to automatically leave a DataGridView cell after entering two characters and move onto the next cell
I'm making a simple game. I want simultaneously go up and left.
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown ' If e.KeyCode = Keys.Z Or e.KeyCode = Keys.Up Then
I am making a simple program that encrypts a text file and then decrypts it: why i get an error when i use this
Public Class Form1 Code: Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click System.IO.File.Encrypt(TextBox1.Text)
Im making a simple image editor and I added Zooming and Drawing with mouse position like a pencil. My problem is When I zoom the image and try to draw on it, everything becomes offset and the lines i drew are not even close to the mouse. Here is My code ( Just add a button1 and Picturebox1 with an image)
Public Class Form1 Dim pen1 As Pen Dim x1, y1, x2, y2 As Integer Dim gr As Graphics
I am making a small game of pong and i want to incorporate a pause feature. is there a way i could freeze the form in place and then unfreeze it later at the push of a button. the tutorial i used is below so check it out to get an idea of what i've made so far.
I've created a user control with a simple text box and a corresponding label and added a few custom control properties. When added to a form, I'm trying to loop through all control of this type and evaluate the custom property. In the below, the cntl.MyCustomProperty is not recognized. I can evaluate the property when I check each user control on the form by name, but not by using the loop below. I would much rather use the loop as it is much cleaner.
For Each cntl As Control In Me.Controls If (TypeOf cntl Is MyUserControl) And cntl.MyCustomProperty = "ABC" Then ''Do some stuff End If Next
I have made a few siple web browser, using a web browser control, a texbox, and a few buttons.I need to learn how to:Make a download handler(like FireFox)Make a custom web browser control(if possible)Use EXTERNAL .EXE's(like toolbars)Make an installer using a background worker, and System.
I am experimenting with CUSTOM CONTROLS for the very first time. What I did so far: I've created a new Windows Control Library project. In there I simply resized the custom control area (made it very wide and only 50 high). I added a pictureBox on the very left, a Label1 with Large text on the right and 2 other labels underneath Label1 on the left and right.Further I've set MOUSE HOVER effects, "Yellow" for MoudeEnter and "White" for MouseLeave.
In a Windows Form application I add this control over and over again into a Panel1 (DockStyle TOP) for each jpg file found in "My Pictures". The PictureBox in My custom control has the Thumbnail of the real picture, the Label1 shows the name of the file.
All this worked out better than I expected for my very first CUSTOM CONTROL, however, there is still 1 thing I would like it to do: being 'selected' when I click on one of the CUSTOM CONTROLS in my Panel1. Does anyone know how to do that? If I set a BackGroundColor change on MouseClick in my custom control, then it surely would change the color, however, it would stay that way even if I click on the next custom control in my Panel1 .(Listing SPEC's is not a review !
I am trying to create a Messagebox/dialogbox that will allow me you Define the Prompt and the text for the two buttons. I started by looking around the internet and found [URL]. It got me started But i don't think i have the libraries to make the stackoverflow.com code work. i don't know enought about events to make the box always have the focus untill it is closed or one of the buttons is pressed. I would also like to return the button.text of the button that was clicked.here is the little code i have
Public Class DialogBoxForm Private _ButtonName1 As String Private _ButtonName2 As String
I was thinking of making a custom skin for my application. I looked into Aero like application like this one. But wait a problem it will not work on XP So my question is do you know were i can get free and good looking GUI. Or can i make the aero work some how on XP.
How would I make my own custom border style? I want to make my own so that the program looks better and havign its own close/minimize button would be awesome also. Here is what I mean by it:[URL] notice it doesnt use the normal xp or vista bar it is its own? How would I go about doing that?
I'd like to make a custom control that allows the end user to format the text, similar to an HTML or RichText control. The idea is that it will be static like a label, but allow end user to specify certain tags around words to make them bold, italic, underline, hyperlink, etc, either at design time or runtime. My question more specifically is how to best approach this. My intention is to use GDI+ methods, like DrawString, etc. But my concern is the inefficiency of having to parse the text each Paint cycle to determine which tags are present in order to use the correct font style, etc. I'm not really asking HOW to do this, but more of a hint on which architectural approach to take on this. Maybe there is already some examples of this out there?
I have created a custom control that has a few labels and a button on it. In my main program i dyanmically add this control to a stackpanel. When i add the control i add a few events for it by doing th e following:
Dim newqueue As New UserControl1 AddHandler newqueue.MouseDoubleClick, AddressOf PrintMessage
How would i go about adding an event for the button.click for the button in the custom control?
I'm trying to do the very basic add "hello" to a button. The instructions tell you to click on the button the tutorials say the code that is supposed to show starts with "public class form1" but when I double click the button it seems to open the whole code of the template, not the button. (and no where in the code shows the "private sub button1_click")
For the simple web browser I am creating I would like to have a combobox displaying different search engines and a button that would take the user to the selected search engine's website address.
Here is the code to load the search engine options: vb.net Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ComboBox2.Items.AddRange({"Google", "DuckDuckGo", "Mahalo", "Ask"}) ComboBox2.SelectedIndex = 0 End Sub
How can i print out an textbox with a simple click button? i prefer it with a dialog where people can select there printer. This is what i found but it doesnt work
Private Sub Button84_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button84.Click Printer.Print(TextBox11.Text) Printer.EndDoc() End Sub
I haven't touched VB or Visual Studio in an incredibly long time, so I appologize if this sounds ignorant.
Right now, my application (pictured below) is a simple button that executes a shell command. I was thrilled that I even managed that, but it got me to wondering if my application could execute that command, rather than sending the process to cmd.exe.
When executing a click event on a button is there a way to know if a user has clicked or if code has executed it by a performClick in the sub that handles the click event. Maybe a change in the sender?
My Com1.text has nothing in it but yet the button1 is still visible when it should be false and not showing. This worked fine in vb6 using command.caption.[code]