Guess I should have look a longer on the net. LOL
PrivateFunction ShiftR(ByVal Number AsLong, ByVal Shift AsInteger)
Dim nIndex AsInteger
For nIndex = 1 To Shift
(Number = Number / 2) replace with Number = Number >> 1
PrivateFunction ShiftL(ByVal Number...
I am attempting to write a function to Shift Right bits.
Private Function ShiftR(ByVal Number As Long, ByVal Shift As Integer)
Dim nIndex As Integer
For nIndex = 1 To Shift
Number = Number / 2
The problem is is it works up to a point. Consider this:
Thanks for the feedback. A friend of mine sent me the same code too. Amazing how KISS it is once you figure it out.
DIM bBlink as Boolean
Private Sub FlashTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FlashTimer.Tick
If bBlink Then...
How do I make a Label Flash. What I want to do is have a Label Flash on command. Such as when I am updating data, I want to make a Label visible and have it Flash until the updating is complete, then I will make it invisible.
kulrom..... Thanks, sometimes you forget the basics and need a remider. I was setting up a legecy system the other day and had to stop and remember some of the commands. It's asamzing how much you can forget.
jmcilhinney... Thanks, I was not sure where this really needed to be posted.
Figured it out. Thanks for the help. The problem was I was trying to use another instance of the sub
Private Sub Tab_Click1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabControl2.SelectedIndexChanged
If TabControl2.SelectedIndex = 0 Then
'set variables for Tab 1...
David..... Getting closer. This works upto a point. Where it fails is where I have multi-tab configuration. What I have is two rows of tabs. I have say three tabs on the top row. Under this I have say 2 tabs assocaited with each Tab on the top row. So I need to beable to select a top tab then...
OK, how would I use it. I need to be able to click on the Tab itself, have varibles set for that Tab. Click on a different Tab and have varibles for that
Tab be set.
Hope I am explaining what I want to do correctly.
Is there a way to turn off/on Tabs under progam control. I have a project that will have multi-Tabs and don't wish to have all of them showing at the same time, only those that I am using at the moment.
A little more info on what I want to do. I have three main tabs TabPage1,2,3
Basicly what I am doing is creating a User Control, populate it with TextBoxes and CheckBoxes,
tie it to a TAB on the MainForm. Then I want to access the TextBoxes and CheckBoxes from
the MainForm. The idea is to create different User Controls that at runtime are attached to the TABS
Here's what I did. I created a User Control Forms. Populated it with Textboxes and CheckBoxes. I then attached it to a tab on main form.
Now I want while in the mainform to put text into the user control textboxes and check/uncheck the checkboxes. The user control form is called "GenReg1.vb"...
As a test I created another form that is displayed using "Show"
Private fOpTest As New TestForm
Private Sub MenuItem18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem18.Click
'Display Test Window
I have a couple of USER CONTROLS that I have textboxes on. I want to send text to these textboxs from the main form. I have it set up as follows
Private fOpGen As New GenReg1 '<- user control form
If sDone = "00" Then
Me.TextBox2.Text = "Test1"
fOpGen.TextBox1.Text = "Test1"...
I have a problem that hopefully someone can tell me what I am doing wrong or a better way to do this. I am sending commands to a device using RS232. When I get the return, it looks OK, but having a problem displaying the results.
First here is the RS232 return routine in the Main Form...
thanks all, got it figured out.
Dim sOut As String
If nOutMask And &H1 Then
If CheckBox1.Checked Then
Mask1 = Mask1 Or &H1
Mask1 = Mask1 Xor &H1
sOut = "W 01 0074 002 " & Mask1
the routines looks at check boxes and sets the integer according to if...