|
I have posted the code earlier into the thread.
|
|
|
|
|
Did you actually correct either of the two errors that have been pointed out to you?
|
|
|
|
|
I have not seen this code-part before - please excuse me.
But : from where comes the content of the Variable (?) "weightRequested"
I still think that more Information could be very useful ...
|
|
|
|
|
Hi guys.
Thanks for the help. I got the code to run error free but now its becoming more complex, but that is for another forum.
Keep on coding...
|
|
|
|
|
I've inherited a VB6 project that uses resources, and they work fine, but when I open the resource file with the resource editor, there are no resources there! Googling hasn't turned up any similar problems.
Anyone have an idea how to get access to the project's resources? Thanks!
modified 14-Apr-16 12:58pm.
|
|
|
|
|
It turns out the geniuses who created this project made their own resource file with their own custom format! Arrgh...the joys of legacy code!
|
|
|
|
|
I want to build a Font Designer Application in VB.NET. With which we can create or designed new type of fonts. But I can't understand what will be the starting point?
|
|
|
|
|
The logical starting point would be to research and understand font files, their format and how they are created.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi
am working on new website with 2 languages only
so far i have succeeded to do it as this
MasterPage on Page_Init event
If (Session("culture") IsNot Nothing) Then
Dim ci As New CultureInfo(Session("culture").ToString())
Thread.CurrentThread.CurrentCulture = ci
Thread.CurrentThread.CurrentUICulture = ci
End If
ManagerBase Class OnInit event
If Session("culture") Is Nothing Then
Dim languages() As String = HttpContext.Current.Request.UserLanguages
If ((languages Is Nothing) OrElse (languages.Length = 0)) Then
Session("culture") = "en-US"
Else
Session("culture") = languages(0).ToLowerInvariant.Trim
If Session("culture").Contains("ar") Then
Session("culture") = "ar-SA"
Else
Session("culture") = "en-US"
End If
End If
End If
Change Language Event
If Thread.CurrentThread.CurrentCulture.IetfLanguageTag = "ar-SA" Then
Session("culture") = "en-US"
MyBase.OnInit(e)
Server.Transfer(Request.Url.PathAndQuery)
Else
Session("culture") = "ar-SA"
MyBase.OnInit(e)
Server.Transfer(Request.Url.PathAndQuery)
End If
the thing is when user choose another page or select different view in the page he lose the culture he selected it
how i can fix it?
|
|
|
|
|
I have two form, Form2 contains dynamically created checkboxes and Form1 has a textbox(TextBoxSelected). I add event handler to the checkboxes that count the total number of checked chekboxes. Now I want to pass the count value to the TextBoxSelected.
CheckBox Code in Form2
Public Sub CreateCheckBox(ByVal _filename As String, ByVal _displayname As String)
Dim checkBox = New CheckBox()
checkBox.Size = New Size(117, 109)
checkBox.Text = (_displayname)
checkBox.Image = resized
checkBox.BackColor = Color.Gray
checkBox.ForeColor = Color.White
checkBox.TextAlign = ContentAlignment.BottomCenter
checkBox.Location = New System.Drawing.Point(XcLocation, YcLocation)
AddHandler checkBox.CheckedChanged, AddressOf myhandler2
End Sub
Private Sub myhandler2(ByVal sender As System.Object, ByVal e As System.EventArgs)
Selected()
End Sub
Private Sub Selected()
Dim count As Integer
count = 0
For Each ctrl As Control In Me.Controls
If TypeOf ctrl Is CheckBox Then
If DirectCast(ctrl, CheckBox).Checked = True Then
count += 1
End If
End If
Next
End Sub
|
|
|
|
|
|
Thanks for those nice tutorials.
|
|
|
|
|
Now ... what is your question ?
I think, that your code which count the checked Checkboxes is working.
Don't you know how to find out, which Textbox is actually selected ?
|
|
|
|
|
|
so ... is your question answered now ?
|
|
|
|
|
Yes. And I solved it out as I mentioned in my previous reply.
|
|
|
|
|
Sub FilterWorkbook()
Sheets("SAT Assignments").Visible = True
Sheets("SAT Assignments").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("K1").Select
Sheets("SAT Assignments").Visible = False
Sheets("SAT OSS Vac Log").Visible = True
Sheets("SAT OSS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("SAT OSS Vac Log").Visible = False
Sheets("SUN Assignments").Visible = True
Sheets("SUN Assignments").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("K1").Select
Sheets("SUN Assignments").Visible = False
Sheets("SUN OSS Vac Log").Visible = True
Sheets("SUN OSS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("SUN OSS Vac Log").Visible = False
Sheets("MON Assignments").Visible = True
Sheets("MON Assignments").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("K1").Select
Sheets("MON Assignments").Visible = False
Sheets("MON DBCS Vac Log").Visible = True
Sheets("MON DBCS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("MON DBCS Vac Log").Visible = False
Sheets("MON OSS Vac Log").Visible = True
Sheets("MON OSS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("MON OSS Vac Log").Visible = False
Sheets("TUE Assignments").Visible = True
Sheets("TUE Assignments").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("K1").Select
Sheets("TUE Assignments").Visible = False
Sheets("TUE DBCS Vac Log").Visible = True
Sheets("TUE DBCS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("TUE DBCS Vac Log").Visible = False
Sheets("TUE OSS Vac Log").Visible = True
Sheets("TUE OSS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("TUE OSS Vac Log").Visible = False
Sheets("WED Assignments").Visible = True
Sheets("WED Assignments").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("K1").Select
Sheets("WED Assignments").Visible = False
Sheets("WED DBCS Vac Log").Visible = True
Sheets("WED DBCS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("WED DBCS Vac Log").Visible = False
Sheets("WED OSS Vac Log").Visible = True
Sheets("WED OSS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("WED OSS Vac Log").Visible = False
Sheets("THU Assignments").Visible = True
Sheets("THU Assignments").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("K1").Select
Sheets("THU Assignments").Visible = False
Sheets("THU DBCS Vac Log").Visible = True
Sheets("THU DBCS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("THU DBCS Vac Log").Visible = False
Sheets("THU OSS Vac Log").Visible = True
Sheets("THU OSS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("THU OSS Vac Log").Visible = False
Sheets("FRI Assignments").Visible = True
Sheets("FRI Assignments").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("K1").Select
Sheets("FRI Assignments").Visible = False
Sheets("FRI DBCS Vac Log").Visible = True
Sheets("FRI DBCS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("FRI DBCS Vac Log").Visible = False
Sheets("FRI OSS Vac Log").Visible = True
Sheets("FRI OSS Vac Log").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A3").Select
Sheets("FRI OSS Vac Log").Visible = False
Sheets("SAT Crew Tags").Visible = True
Sheets("SAT Crew Tags").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A1").Select
Sheets("SAT Crew Tags").Visible = False
Sheets("SUN Crew Tags").Visible = True
Sheets("SUN Crew Tags").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A1").Select
Sheets("SUN Crew Tags").Visible = False
Sheets("MON Crew Tags").Visible = True
Sheets("MON Crew Tags").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A1").Select
Sheets("MON Crew Tags").Visible = False
Sheets("TUE Crew Tags").Visible = True
Sheets("TUE Crew Tags").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A1").Select
Sheets("TUE Crew Tags").Visible = False
Sheets("WED Crew Tags").Visible = True
Sheets("WED Crew Tags").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A1").Select
Sheets("WED Crew Tags").Visible = False
Sheets("THU Crew Tags").Visible = True
Sheets("THU Crew Tags").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A1").Select
Sheets("THU Crew Tags").Visible = False
Sheets("FRI Crew Tags").Visible = True
Sheets("FRI Crew Tags").Select
Selection.AutoFilter Field:=1, Criteria1:="="
Range("A1").Select
Sheets("FRI Crew Tags").Visible = False
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("Main Menu").Select
MsgBox_10
MainMenu
End Sub
|
|
|
|
|
You can see what it does. Alternatively you can run the code and watch it happening.
|
|
|
|
|
I run the code (F5) but I can't see what it actually does.
|
|
|
|
|
Then you need to compare the workbook before and after, and check that all parts of the code are working correctly.
|
|
|
|
|
Try using F8 and going through it step by step
|
|
|
|
|
Hi, i am working in VB 2010 an a one-time pad software.
The problem is the following. I have a txt file with many continous characters like this "KHKJHDKJDHAKHDAKHDAKHAKDHADHAKJDHASJDHA", i need to read a variable number of this characters and after replace it with a same number of dots (Ex. "zxsd" replaced with "....").
Now, with this code i can read the characters from specific position:
Using stream = File.OpenRead("c:\key.txt")
stream.Seek(v, SeekOrigin.Begin) ' v = startup position for read in file key.txt
Dim b = New Byte(a - 1) {} ' a= lenght of text in key.txt to be taken)
stream.Read(b, 0, a)
Dim str = Encoding.ASCII.GetString(b)
txtPad.Text = str
End Using
But how i can do for replace text extracted with dots without delete any line?
|
|
|
|
|
Why would there be line breaks in the OTP file which aren't meant to be part of the OTP data? Doesn't make much sense to me - if you're at liberty to change that, I would recommend to do so.
First, you'll have to open the file for read/write access instead of read-only. Then, after reading your OTP string, you'll have to seek again to the position where you started to read it. Then you'll have to write the replacement-string there. There's more than one way to do this - one way would be to convert the source string into a char-array, loop over the characters in that array and write a dot to the file for every character that isn't part of a line break and write line-break characters unmodified to the file.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Uhm why not read in the string and use string.replace() or am I missing something?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
For that he would have to have the substring-data that should be replaced as a string but it shouldn't be needed as a string for any other purpose, if I'm interpreting things right. Instead he should be looping over the single characters anyway in the encryption part.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|