Triangle Asterisks Of For Loop In VB
Every time I press for button, it will display triable asterisk according to four patterns:
I need four command button, How can I solve them>? Loop sequential in that!
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Passwords To Asterisks...
I have password protected an action on a form that prompts for a password before the change the user wants to make is allowed (user clicks a box, the password prompt shows up, if the correct password is entered, the box is checked, if not, the box remains unchecked.)
Private Sub TSCRApproval_Enter()
Dim strMsg As String, strInput As String
If fEditTSCRApproval = False Then
If MsgBox("Do you want to change approval?", vbYesNo + vbQuestion + vbDefaultButton2, "Confirmation") = vbYes Then
strMsg = "Password is incorrect. Contact TSCR admin for support."
strInput = InputBox("Enter Password")
If strInput <> "" Then
Do While strInput <> "1111"
If MsgBox(strMsg, vbOKCancel, "error") = vbOK Then
strInput = InputBox("Enter Password")
Me!TSCRApproval.Locked = False
fEditTSCRApproval = True
How do I get the password to show up as asterisks as the user is typing it in?
Changing Text To Asterisks
I have created a spreadsheet in excel with lots of different sheets. I have basically added a login screen where you have to log in to the spreedsheet to be able to view the other sheets.
So you click the login button and a popup box ask for a password (Which is all coded in VB) but when i type the password you can see what i am typing, i want to be able to change that to asterisks, for example if my password was chris is should look like this ***** so the password is hidden.
Does anyone know how to do this
How To Decrypt Password Asterisks
Hello, I need help. I am developing a piece of software which, among other things, should contain a function which allows you to decrypt the asterisks used to hide passwords. It should be able to unmask all the passwords visible on the screen.
In order to get this, I placed the following code in a module:
'---START OF VB CODE---
Public Declare Function EnumChildWindows Lib "User32" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Public Declare Function EnumWindows Lib "User32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Public Declare Function SendMessage Lib "User32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long
Public Declare Function ShowWindow Lib "User32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Const EM_GETPASSWORDCHAR = &HD2
Public Const EM_SETPASSWORDCHAR = &HCC
Public Const EM_SETMODIFY = &HB9
Public Const SW_HIDE = 0
Public Const SW_SHOW = 5
Public Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Long
EnumChildWindows hwnd, AddressOf EnumWindowsProc2, 1
EnumWindowsProc = True
Public Function EnumWindowsProc2(ByVal hwnd As Long, ByVal lParam As Long) As Long
If SendMessage(hwnd, EM_GETPASSWORDCHAR, 0, 1) Then
EnumWindowsProc2 = True
Public Sub UpdateWindow(hwnd As Long)
SendMessage hwnd, EM_SETPASSWORDCHAR, 0, 1
SendMessage hwnd, EM_SETMODIFY, True, 1
ShowWindow hwnd, SW_HIDE
ShowWindow hwnd, SW_SHOW
Public Function UnmaskPasswords()
EnumWindows AddressOf EnumWindowsProc, 1
'---END OF VB CODE---
This function seems to work perfectly when used under Windows 95, 98 and Me. To unmask all the asterisks on the screen, just call UnmaskPasswords.
The problem arises when you run the software containing the function above under Windows XP, where the characters used to conceal the passwords are not asterisks but round-shaped bullets. In that case, calling the UnmaskPasswords function produces no results.
Does anybody know how to make the code work with both the asterisks and the bullets?
Thanks in advance.
Help!! Asterisks In Shape Of A Diamond
Hello, if someone out there can help me I'd really appreciate it. My homework was to create a diamond shape (not filled in) with asterisks using a For...Next loop. The diamond will be displayed in the immediate window.
The code below is what I have finally figured out, but I can't seem to figure out how to "draw" the right side of the diamond. I'm soooo frustrated because I feel this is way above my level and my teacher, who is a real professional teaches us as if we know tons but we just started learning computers for the first time this year. Please Help if you can. Thanks to all who try to help!!!
Dim I As Long
For I = 5 To 1 Step -1
Debug.Print Space(I - 1) + "*"
For I = 0 To 4
Debug.Print Space(I) + "*"
This is what shows up so far in the immediate window
Hiding Passwords With Asterisks
I have been searching through previous posts on passwords for a few hours now but have been unable to find the information I am after. As you can see I am fairly new to VB. Please accept my apologies if you have read a similar post before (if you have please tell me where I can find it).
What I am trying to do is hide the password text on a login screen with asterisks. I am not sure if this has a proper name? I have gone into the password input textbox_change code and have a sort of loop that sets the text value of the text box to * but I've realised I don't really want to do that as this changes the password to *. Anyone got any ideas?
How Do I Draw Shapes With Asterisks?
I was wondering how I would draw the shape of an (X) or a right right angled triangle using asterisks(*). It is in an if/else statement. I just need to know how 2 draw those shapes.
Thanks in advance.
Input Box For Password - Show Asterisks
I have two simple VB input boxes in Excel to capture username and password. I want the box for the password to display asterisks ***** instead of the text typed in to preserve security.
I have had no luck finding how to do this. Can anyone help?
Need Code To Manipulate A String To Asterisks
I made a password input box by my self in Citect with a rectangle as border and a text viewing area.
In the rectangle I can input a string which is viewing in text veiwing area.
I want that I can only see asterisks, because it is a password field.
I need the code which is used by the normaly password inputboxes of the most developer programs, in this case VBA.
Can someone help me, thanks
Here's a beautiful effect made in VB.
No APIs. No DX. Just VB.
Do you like it?
Edit: Removed .exe from attachment
how can i create the effect of making a triangle shape by only using the print statement like so...
but having all the b's centered in the middle of the form by being spaced over with a simple Print " "
Can you tell me what component i shuld use in order to add some triangle to my form ?
A Triangle As A Button??
All I want to do is simply find a way to make a clickable triangle.
Squares, circles, and their variations are clickable and can be used as buttons.
I want to do the same with a triangle.
It doesn't matter right or isoceles or whatever, just as long as it's a triangle.
Fill In A Triangle. Can An API Be Used To Do This?
Hi, some of you know that I am making a 3D Engine.
That 3D Engine uses triangles(The most common and basic object used in most 3D Engines) well know I have made the wireframe rendering, but I need to fill in the triangles with a color.
Is there any API to do this or what?
Please show me an example of how to do it in a picture box.
Thanks alot in advance.
my triangles are being drawn backwards, any ideas?
Cube(0) = CreateTLVertex(-1, -1, 1, 0, RED, 0, 0, 0)
Cube(1) = CreateTLVertex(-1, 1, 1, 0, RED, 0, 0, 0)
Cube(2) = CreateTLVertex(1, -1, 1, 0, WHITE, 0, 0, 0)
Cube(3) = CreateTLVertex(1, 1, 1, 0, WHITE, 0, 0, 0)
Cube(4) = CreateTLVertex(2, -1, 1, 0, BLUE, 0, 0, 0)
Cube(5) = CreateTLVertex(2, 1, 1, 0, BLUE, 0, 0, 0)
it seems to fade from red to blue from right to left instead of left to right
sorry posted in wrong thread, cant move post ;]
My program is "Triangle Problem" in Visual Basic Windows Appliacation
The User enter 3 sides lengths of triangle in 3 TextBox ,An appropriate error message should appear in the form, in case of the three numbers not valid sides of a triangle.
Exampe: side a plus side b has to be greater than side c in a triangle, where side c is the largest side in length.
I have one TextBox Readonly that tell me type of Triangle based on angles:
"Right triangle" ----if c2/(a2 + b2) = 1
"Acute triangle"---- if c2/(a2 + b2) < 0.9999
"Obtuse triangle"----if c2/(a2 + b2) > 1.0001
The Program should read 3 decimal numbers ,The user should be able to move from one textbox to another by either using the “tab” control key or the “enter” key. The user should not be able to make any mistake in the textboxes. That is, the user should not be able to enter a non-numeric character.If User Finish enter deciaml number in TextBox3 and Press Enter or Tab the Program automaticaly Appear the type of Triange Based on angles in ReadOnly TextBox.
I should Create at a functions that determines the type of a triangle based on angles.
Drawing A Triangle
Hi im trying to draw a triangle in vb i know i need to use the line method to do this and the distance formula nut im still a bit lost as to what to do if any one could help that could be great
Does anyone have any code for triangle shapes, that include fillcolor? I need something that allows me to specify x,y for one point of the triangle, the angle of that point, the angle of the centerline of the traingle, length of the sides.
I'm trying to make it so that I can rotate a triangle around a point. It's for a sector management program for microwave communications. I'm attempting to make a program that can automatically adjust or create a whole plan of cell array radio channels by itself.
"None of us is as smart as all of us"
Hi, got a problem here that might be very easy to solve, but I can't find out how to do it:
I need to make a shape that is not a predefined one but a triangle. I can draw one consisting of 3 lines of course but I need to be able edit certain properties like fillcolor and visibility.
Lines will be treated as seperate objects and I need my shape to be the (single) object.
Also using the "Line" option won't help me coz I can't make an object out of this. I'm feeling I'm missing a certain tool/property here. (I'd rather not download some activex control btw, but if I have to I will)
Any suggestions ?
Thanks in advance
I need to make this program which asks the user to enter a height between 2 and 9, and it makes the height of the triangle as big as that number like if it was 4 it would look like
( except it centered)
But It cant go above 9 or below 3.
Here is my code... it doesnt work though
Dim intheight As Integer
Dim intNumLines As String
Dim intAccum As Integer
Dim strstar As String
intheight = txtNumber.Text
intNumLines = txtNumber.Text
strstar = "*"
intAccum = intAccum + 1
lblHeight.Caption = strstar & vbCrLf
Loop Until intAccum = intNumLines
I have made the following triangle pattern using the code below.......(I am trying to figure out the correct code for two other triangles listed below the following code)
Dim r, c As Integer
Dim field As String
Dim sw As IO.StreamWriter
sw = IO.File.CreateText("Triangle.txt")
For r = 1 To 4
For c = r To 4
field = c.ToString
field = field.PadLeft(4)
Two patters I am trying to make:
1 2 3 4
2 3 4
2 3 4
1 2 3 4
Thank you so much if you can help me!
Shading A Triangle
I have a code below to draw a triangle network
m = 1 While Not EOF(2) Input #2, TIN.Node1, TIN.Node2, TIN.Node3 picDraw.Line (XY(TIN.Node1, 0), XY(TIN.Node1, 1))-(XY(TIN.Node2, 0), _ XY(TIN.Node2, 1)), vbBlue picDraw.Line (XY(TIN.Node2, 0), XY(TIN.Node2, 1))-(XY(TIN.Node3, 0), _ XY(TIN.Node3, 1)), vbBlue picDraw.Line (XY(TIN.Node3, 0), XY(TIN.Node3, 1))-(XY(TIN.Node1, 0), _ XY(TIN.Node1, 1)), vbBlue m = m + 1 Wend
How can I fill a color let say green into the triangle so it will look like solid triangle rather than just a line network. Please can anybody help..
Triangle ASCII Art Help
I'm new to VB and have a problem of printing an ascii art triangle using loops. I have to have a user enter a number between 5 and 8. That number is the largest horizontal point of the triangle. So if a user input 5, the output should be:
This is the logic i'm using as of now:
Private Sub Make(tSize As Integer)
Dim LineCount As Integer, AsterikCount As Integer
For LineCount = 1 To tSize
For AsterikCount = 1 To tSize
and when i put in 5 as the input, the output is:
and so on...
ANY help would be appreciated.
Drawing A Triangle
can anyone kindly show how to draw a triangle? I don't really understand how to do it. Hopefully some explanation would be great.
*back to reading da VB book*
Anybody know where I can get a triangle shaped button?
already made and free would be best,
However, I'm open to API suggestions.
CIRCLE - Triangle ANYTHING
I have a queation how do you make the form be in any other shape then a square or a rectangle like a circle or a triangle or a polygon. Someone told me something about masking which i have no idea what it is. I am getting bored of the stupid same rectangular form
Hi, I was just wondering how is it possible to program the Sierpinski Triangle on visual basic. Also I know it is possible because I have seen the program working before.
Triangle In A Circle
I don't know why, but I've programmed the code below so that the three corners of the triangle will always be touching the perimeter of the circle. But this isn't happening.
I fixed the code below so you can copy and paste it into a form, but you'll notice sometimes a corner is way out of the circle. What should I do to my code to make it work?
Dim Theta As Single
Dim adj As Integer, r As Integer
Dim theta2 As Integer, thetaRad2 As Double
Dim opp As Integer, area As Integer
Dim hypot As Double, thetaRad As Double
Dim chooseSide As Integer, randRoot As Integer
Dim areaTri As Integer
Dim variableAngle As Single, variableAngleRad As Double
Private Sub command1_click()
randRoot = 2 + Int(5 * Rnd) 'the integer inside the square root sign
chooseSide = 1 + Int(2 * Rnd) 'choose base or perp height
Call getAngle3(330, 60) 'grt random angle between 330 and 390 deg
r = 8
theta2 = 270 'perpendicular diameter
thetaRad = degToRad(Theta) 'to radians
thetaRad2 = degToRad(theta2 - 180) 'to radians
'calculate the lengths of the lines
opp = linelength(r * Cos(-thetaRad2), r * Cos(thetaRad), r * Sin(-thetaRad2), r * Sin(thetaRad))
adj = linelength(r * Cos(thetaRad2), r * Cos(thetaRad), r * Sin(thetaRad2), r * Sin(thetaRad))
areaTri = getArea(opp, adj) 'find the triangles area using the side lengths calculated above
'draws the diagram for this question
Form1.DrawWidth = 3
Form1.DrawMode = 13
'determines the size of the form - needed to ensure that all lines touch the circle
Form1.Height = 6300
Form1.Width = 7200
variableAngle = 10 + Int(30 * Rnd()) 'rotate diameter
variableAngleRad = degToRad(variableAngle) 'to radiand
Form1.Scale (-14, 11.9)-(14, -11.9) 'origin to the center of the form
Form1.Circle (0, 0), r 'draw circle, radius r
'the following 4 lines draw the lines inside the circle of the diagram.
'the lines are based on the origin, r, and the SIN or COS of the randomly generated angle
Form1.Line (0, 0)-(r * Cos(thetaRad2 + variableAngleRad), r * Sin(thetaRad2 + variableAngleRad))
Form1.Line (0, 0)-(r * Cos(-thetaRad2 + variableAngleRad), r * Sin(-thetaRad2 + variableAngleRad))
Form1.Line (r * Cos(thetaRad2 + variableAngleRad), r * Sin(thetaRad2 + variableAngleRad))- _
(r * Cos(thetaRad), r * Sin(thetaRad + variableAngleRad))
Form1.Line (r * Cos(-thetaRad2 + variableAngleRad), r * Sin(-thetaRad2 + variableAngleRad))- _
(r * Cos(thetaRad), r * Sin(thetaRad + variableAngleRad))
'prints the angle given in the question near the center
'currentX and currentY determine the immediate position to where the
'text will be positioned
Form1.CurrentX = r * Cos(-thetaRad2 + variableAngleRad) + 1
Form1.CurrentY = r * Sin(-thetaRad2 + variableAngleRad) + 1
Form1.CurrentX = r * Cos(thetaRad2 + variableAngleRad) + 1
Form1.CurrentY = r * Sin(thetaRad2 + variableAngleRad) + 1
Form1.CurrentX = (r * Cos(thetaRad + variableAngleRad) + 1)
Form1.CurrentY = r * Sin(thetaRad + variableAngleRad) + 1
Public Sub getAngle3(x As Integer, y As Integer)
Theta = x + Int(y * Rnd())
Public Function degToRad(deg As Single) As Double
degToRad = (deg * 3.1416) / 180
Private Function linelength(x1 As Integer, x2 As Integer, y1 As Integer, y2 As Integer) As Integer
linelength = (Sqr(((x2 - x1) ^ 2) + ((y2 - y1) ^ 2)))
Private Function getArea(base As Integer, perp As Integer) As Integer
getArea = (base / 2) * perp
Rotating A Triangle
In order to make a triangle you would have to use 3 lines. I have tried tons and tons of code to see if i could get the whole triangle to rotate on a center point. Well i Have failed miserably. Then I tried to get a line to rotate on its center and I did alright but didn't come to anything that was completely working. Does anyone have any idea how to get a triangel to rotate on a center point? Thanks!!!
Put this Code in a standard module.
Private Type POINTAPI
x As Long
y As Long
Private Const POLYFILL_LAST = 2
Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Private Declare Function FillRgn Lib "gdi32" (ByVal hdc As Long, ByVal hRgn As Long, ByVal hBrush As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
Public Function FillTriangle(hdc As Long, X1 As Long, Y1 As Long, X2 As Long, Y2 As Long, X3 As Long, Y3 As Long, Colour As ColorConstants)
Dim apiPoints(0 To 2) As POINTAPI
Dim hRgn As Long
Dim hBrush As Long
apiPoints(0).x = X1
apiPoints(1).x = X2
apiPoints(2).x = X3
apiPoints(0).y = Y1
apiPoints(1).y = Y2
apiPoints(2).y = Y3
hRgn = CreatePolygonRgn(apiPoints(0), 3, POLYFILL_LAST)
hBrush = CreateSolidBrush(Colour)
FillRgn hdc, hRgn, hBrush
then you can use this to draw your triangle. to draw a blue triangle in Picture1 with corners at 50,0 0,100 and 100,100 just type
FillTriangle Picture1.hdc, 50, 0, 0, 100, 100, 100, vbBlue
N.B. the measurements must be in pixels, use the ScaleY and ScaleY functions to help convert.
Hope this helps
Properties Of Triangle
Hi, I'm writing a prog that computes various
properties of a triangle. I want to output properties
such as area, centroid, perimeter & whether triangle
is isosceles or right-angled. this is what i've come
up with so far, but for isosceles & right-angled the
prog keeps returning false & true for every set of
data. Any help would be great.
Public Class frmAssignment03
#Region " Windows Form Designer generated code "
Public Sub New()
'This call is required by the Windows Form
'Add any initialization after the
'Form overrides dispose to clean up the component
Protected Overloads Overrides Sub Dispose(ByVal
disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
'Required by the Windows Form Designer
Private components As
'NOTE: The following procedure is required by the
Windows Form Designer
'It can be modified using the Windows Form
'Do not modify it using the code editor.
Friend WithEvents lblCaption As
Friend WithEvents fraInput As
Friend WithEvents lblVertex1 As
Friend WithEvents fraSolution As
Friend WithEvents cmdCalculate As
Friend WithEvents cmdClear As
Friend WithEvents lblVertex3 As
Friend WithEvents lblVertex2 As
Friend WithEvents txtVertex1x As
Friend WithEvents txtVertex2x As
Friend WithEvents txtVertex3x As
Friend WithEvents txtVertex1y As
Friend WithEvents txtVertex2y As
Friend WithEvents txtVertex3y As
Friend WithEvents Label1 As
Friend WithEvents Label2 As
Friend WithEvents Label5 As
Friend WithEvents Label6 As
Friend WithEvents Label7 As
Friend WithEvents lblPerim As
Friend WithEvents Label10 As
Friend WithEvents lblArea As
Friend WithEvents lblIso As
Friend WithEvents lblRA As
Friend WithEvents txtCentroidx As
Friend WithEvents txtCentroidy As
Friend WithEvents lblCentroid As
Friend WithEvents lblPerimeter As
Me.lblCaption = New
Me.fraInput = New
Me.Label2 = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.txtVertex3y = New
Me.txtVertex2y = New
Me.txtVertex1y = New
Me.txtVertex3x = New
Me.txtVertex2x = New
Me.txtVertex1x = New
Me.lblVertex3 = New
Me.lblVertex2 = New
Me.lblVertex1 = New
Me.fraSolution = New
Me.txtCentroidy = New
How To Fill A Triangle
how can we fill a triangle without using api ,instead please suggest a similar code like filling of block on the form(not on picture box).it is very sad that i couldnot get a simple code for this .
how can I draw triangle without using lines.
I think I can use API functions??????
How To Draw A Triangle
I need to draw a triangle for my Lab. I have three lenghts and three angles, and they are all knows, how can I draw a triangle. Please don't assume that any angle in the triangle is right angle.
I would appreciate any help,
Inner Triangle Size
I have a Triangle where i have all the sizes the problem is i am trying to work out the sizes of a triangle that is inside the existing triangle i can code how to work out the outer triangle but im stuck how to work ot the inner triangle
i have inclosed a pic of my problem
Thanks in advance if anyone can help
I am new to vb. I want to draw a triangle using vb. But the problem here i facing is my professor said that you have to have only 3points for your triangle. (i.e) p1 as top point,p2 as lower left,p3 as lower right. I don't have any idea? Can any one give me the idea or code for this? Thanks.
How Fill In Color In Triangle???
i wanna drawing a triangle with black color and fill the inside parth with white...so far i only know how to fill up rectangular and circle, how to fill up other shapes?thx a lot
Clicking Inside A Triangle
hello i have a huge problem that i have spent hours trying to figure out and i so far i have got no where
so heres the story
i have created a class module that draws a triangle with its size determined by user input. Once the triangle has been drawn i need the user to click anywhere on the screen if the user clicks inside the triangle a message should appear telling the user that they have clicked in the triangle. I have worked out the gradient of the triangle but as far as determining wheather the user has clicked inside the triangle or not i have no idea's does anyone have any clues
Clipping Cursor Within A Triangle In VB
I want to know if there is any way of clipping a cursor within a triangle.
ClipCursor takes a rectangle as an input but not a triangle.
Thanks in advance,
Drawing A Triangle Using 3rd Party OCx, VBx
I have 2 queries, I am hoping any of u guys can be of assistance.
1. How can one make a listview subitems have different back colors on each row.
2. Is there any known OCX or controls one can use to draw a tringle shape on a form, that will have a click and dragdrop events or window handle
Triangle Strips Won't Work!!
I'm pretty new to using DirectX, so this problem is most likely because I'm missing something obvious. But since I can't find the answer anywhere else on the web, I'm asking here.
I have defined 6 vertices, and then loaded them into a Vertex Buffer. With this code, I get a perfect looking rectangle:
d3dDevice.SetStreamSource 0, PolygonVertexBuffer, Len(Polygon1.v(0))
d3dDevice.DrawPrimitive D3DPT_TRIANGLELIST, 0, 2
Note: Polygon1.v is an array with all of the vertices
When I change Polygon1 to only 4 vertices (for a triangle strip), and then change to this code:
d3dDevice.SetStreamSource 0, PolygonVertexBuffer, Len(Polygon1.v(0))
d3dDevice.DrawPrimitive D3DPT_TRIANGLESTRIP, 0, 2
I only get the first triangle to appear! How do I get it to be a rectangle?
Thanks in advance!
How To Spin A Triangle In A Circle?
I've seen examples of triangles spinnin in circles and have had a look at the code but dont fully understand..
this is what i know
You have a main point with 3 other points equally distance from the middle and each other
then u move the 3 points around the middle point while still being eually distance from the middle and each other
if someone has done this before could you show some example code
Showing A Triangle List
I'm wondering if there's a way to make my Triangle Strip visible. I don't mean a texture put onto the strip or it showing a colour,
I mean the lines connecting each vertex. I guess it would be the skeleton of the Triangle Strip.
Is there some sort of flag I can pass when rendering or declaring the strip that could accomplish this?
Thanks for any insight