|
Yep, i tried something of this nature but couldn't meet the requirement.
Dim YGap As Long
Dim XGap as Long
Dim setHeight As Integer 'set boy2 at the rear height
Dim curY as Long' get the boy2 current y position
then on form load, i added this
YGap=Me.Height
XGap=Me.Width
on timer tick, i added this
boy2.Top = boy2.Top + 100
curY=boy2.Top
If curY <= YGap/20 Then
setHeight = 900
boy2.Height = setHeight
End If
If curY <= YGap/15 Then
setHeight = 1200
boy2.Height = setHeight
End If
If curY <= YGap/10 Then
setHeight = 1400
boy2.Height = setHeight
End If
If curY <= YGap/5 Then
setHeight = 1800
boy2.Height = setHeight
End If
then, i added this to ensure boy2 returns to his starting once he gets to the Me.ScaleHeight
If boy2.Top >= Me.ScaleHeight Then
boy2.Top = Me.ScaleTop + 500
End if
but, not working fine. Please give any idea.
|
|
|
|
|
Otekpo Emmanuel wrote: but, not working fine. I have no idea what that is supposed to mean.
Part of your problem is that you are using absolute values in your calculations, rather than scale values based on percentage differences between the images, and maybe even the background. The issue is really a mathematical problem rather than a programming one.
Also please use <pre> tags round your code so it looks readable like:
If boy2.Top >= Me.ScaleHeight Then
boy2.Top = Me.ScaleTop + 500
End if
|
|
|
|
|
Ok thanks. Then, what is the best idea? And please, i just downloaded something of that nature but unable to get the flow of the codes because there are no comments to understand the flow.
The poster declared
<pre>Dim i,j As Integer
p(200,200)</pre>
and he went further to say
<pre>For i=1 To 200
For j=10 To 150
p(i,j) = 1
Next
Next
For i=20 To 100
For j=10 To 100
p(i,j) = 1
Next
Next</pre>
and so on...
What does this really mean? Please, any idea because am lost at the post and it was posted 2005 not sure if there will be any reply if i ask there.
|
|
|
|
|
Otekpo Emmanuel wrote: What does this really mean? Sorry I have no idea. But there are many articles around that deal with displaying 2d and 3d images, such as can be found by Google searching[^].
|
|
|
|
|
Ok, thanks. Really appreciate your effort.
|
|
|
|
|
Dear
i Need Some Help in Visual Basic msflexgrid.
I Need To Create A msflexgrid Like Busy Accounting Software.
Can U Help Me .
Anuj Mittal
anujkumarmittal@gmail.com
9313501001
|
|
|
|
|
akmckd wrote: Can U Help Me .
I would say it is very unlikely, most of us moved on from VB more than YEARS ago and will no longer have expertise in a dead language.
You should not be putting your effort into a VB6 development but looking at rewriting the application using Visual Studio Express[^] which is FREE and includes VB.Net.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Publishing your email address (and phone number also) is considered an invitation for sending spam to you.
By the way, there are fora which block people who publish email addresses!
|
|
|
|
|
akmckd wrote: i Need Some Help Then you need to explain exactly what help.
|
|
|
|
|
Please be gentle, my first post. I am new at vb.net and am need help syncing my textbox and data grid so that when I move to the next record in the textbox the grid view also moves to the new row. Listed is my code, help would be greatly appreciated.
Private Sub OpenDataGrid()
Dim sql As String
'********************* Populate DataGrid *********************
Try
sql = "SELECT * FROM TempCreditors;"
MyConn = New OleDbConnection
MyConn.ConnectionString = connString
ds = New DataSet
tables = ds.Tables
da = New OleDbDataAdapter(sql, MyConn)
cm = New OleDbCommand(sql)
da.TableMappings.Add("MyTables", "MyTables")
da.FillSchema(ds, SchemaType.Source, "TempCreditors")
da.Fill(ds, "TempCreditors")
Dim view As New DataView(tables("TempCreditors"))
grdDisplay.DataSource = ds
grdDisplay.DataMember = ds.Tables("TempCreditors").TableName
Catch ex As Exception
MessageBox.Show("Unable to connect to database, or an error occurred.")
End Try
'********************* End Populate DataGrid ******************
Binding_Source.DataSource = ds 'grdDisplay.DataSource
Binding_Source.DataMember = ds.Tables("TempCreditors").TableName 'grdDisplay.DataMember
'Bind Form's Textboxes
txtCreditor.DataBindings.Add("text", Binding_Source, "Creditor", False)
txtAmount.DataBindings.Add("Text", Binding_Source, "Amount", False)
txtAmtPaid.DataBindings.Add("Text", Binding_Source, "Amt Paid", False)
txtRemBal.DataBindings.Add("Text", Binding_Source, "Rem Bal", False)
'Right Align GridView text
grdDisplay.Columns("Amount").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
grdDisplay.Columns("Amt Paid").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
grdDisplay.Columns("Rem Bal").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
With grdDisplay
'Set Column Properties
.Width = 610
.Columns("Creditor").Width = 250
.Columns("Amount").DefaultCellStyle.Format = "c"
.Columns("Amt Paid").DefaultCellStyle.Format = "c"
.Columns("Rem Bal").DefaultCellStyle.Format = "c"
'Hide Columns
.Columns("ID").Visible = False
.Columns("Due Date").Visible = False
.Columns("Paid").Visible = False
.Columns("Mid Month").Visible = False
.Columns("End Month").Visible = False
.Columns("Due Month").Visible = False
' .Columns("Rem Bal").Visible = False
.Columns("Pay Date").Visible = False
.Columns("Deduction").Visible = False
End With
'Bind Grid to Nav buttons
MyCM = CType(BindingContext(Binding_Source), CurrencyManager)
MyCM.Position = 0
' grdDisplay.Rows(0).Selected = True
End Sub
JLS
|
|
|
|
|
josephls wrote:
Add another entry at that point.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi.. Am Trying disable taskmanager through button click in vb.net but it gives me error .
registry access is not allowed.
But i have logged in as ADMIN only..
Below is the code am using....
Dim systemRegistry As RegistryKey = Registry.CurrentUser.CreateSubKey(&quot;Software\Microsoft\Windows\CurrentVersion\Policies\System&quot;)
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
systemRegistry.SetValue(&quot;DisableTaskMgr&quot;, 1)
systemRegistry.Close()
End Sub
|
|
|
|
|
If you're getting "Access Denied", you're not running the code as an Administrator.
Since you're putting the value under CurrentUser, this will only disable Task Manager for the user running the code and not disable it for everyone who uses the machine.
|
|
|
|
|
I don't think that key exists in HKCU. Use regedit to check.
|
|
|
|
|
Under your Solution in your project name, (Click show all files button above your solution) there is a folder called my project, expand it and open the app.config. Change this line:
<requestedExecutionLevel level="asInvoker" uiAccess="false" /> to one of these:
<requestedExecutionLevel level="requireAdministrator" uiAccess="true" />
<requestedExecutionLevel level="highestAvailable" uiAccess="true" /> You can elevate your application to admin level by using the below code:
.NET
Dim RunAdminMode As ProcessStartInfo = New ProcessStartInfo()
RunAdminMode.UseShellExecute = True
RunAdminMode.WorkingDirectory = Environment.CurrentDirectory
RunAdminMode.FileName = Application.ExecutablePath
RunAdminMode.Verb = "runas"
Try
Dim p As Process = Process.Start(RunAdminMode)
Catch RunAsAdmin As Exception
Return
End Try
C#
ProcessStartInfo RunAdminMode = new ProcessStartInfo();
RunAdminMode.UseShellExecute = true;
RunAdminMode.WorkingDirectory = Environment.CurrentDirectory;
RunAdminMode.FileName = Application.ExecutablePath;
RunAdminMode.Verb = "runas";
try {
Process p = Process.Start(RunAdminMode);
} catch (Exception RunAsAdmin) {
return;
}
Regards,
CodingK
|
|
|
|
|
I would like to learn visual basic - so I bought a book but I don't even know what software to buy to program with. I want to learn how to program for CAD applications but I would like to play and have fun with VB as well. I don't want to spend a bunch of money if I don't have to however if I have to then I will be happy to do so. My problem is that I am brand new and don't know the best way to get started.
I just bought the book: Beginning Visual Basic 2012 by Bryan Newsome.
Any advice would be greatly appreciated.
Thanks!!
Kaz
|
|
|
|
|
|
|
Get a copy of Visual Studio Express from Microsoft[^]. It's free and provides everything you need to get started. There are also hundreds of articles here on CodeProject, and in the wider community that will help you.
|
|
|
|
|
Thank you sir for your response and great suggestion - I appreciate your time!
|
|
|
|
|
If you are just starting out consider learning c# instead of VB, the reason, there are dramatically more examples and support resources for c# than there is for VB.net, unless of course your CAD application uses VB for it's scripting language.
And you still need visual studio express.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thank you sir for your response. I took a class in C 20 years ago and still have a bit of it in the back of my mind. My only problem is the CAD scripting is in VBA so I would like to learn VB if possible. Thank you for your Visual Studio Express suggestion.
|
|
|
|
|
Be a little careful that you are working with the correct platform, VBA is very different from VB.net. I would check if the CAD is using the old VBA, based on VB6 or VSTO which will be using VB.net.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thank you for your response. - CATIA is the CAD system I use - from my understanding it uses VBscript VBA and CATscript. I figure learning any VB type code will give me better skills when I go into the VBA scripting even though it is different.
Thanks
|
|
|
|
|
I would like to add everytime I mention VBA to my programing friends they all make wrinkled faces and shake their head - I realize it is a dead language but CATIA is very much alive and used by the vast majority of the aerospace biz. Thanks for your suggestions
Kaz
|
|
|
|