|
Sorry, I am not a VBA expert, and this forum is mostly for VB/VB.NET questions.
|
|
|
|
|
I know but this the best forum I know
|
|
|
|
|
There are forums dedicated to VBA, you should try one. Just Google something like "VBA printer settings", and see what it gets you.
|
|
|
|
|
hello ...
can you help me please
how can change font size in richtextbox ,if selection some text in rtb have a more than one font name
if rtb.selection isnot nothing then
rtb.selectionfont=new font(rtb.selection.fontfamily,cint(combobox1.selecttext))
else
this statment can not programming
endif
|
|
|
|
|
|
Member 12436170 wrote: if selection some text in rtb have a more than one font name You have the selection-start, and its length.
Select the first character, get the name of its font, and increase its size. Repeat for the next character.
Bonuspoints if you keep increasing the selection if the next character has the same font.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi.
I got this error and can't seem to solve it. I've changed the code but it gives a error message that I have coded into the program. I've read most of the articles here about it but just can't figure it out. This is the line of code; msgBox(sendWeightRequest). I have changed it to this;
Private Sub btnGet_Click(sender As System.Object, e As System.EventArgs) Handles btnGet.Click
If sendWeightRequest() = "ERROR" Then
WriteLine("Cannot read weight...")
Else
MessageBox.Show(sendWeightRequest)
End If
End Sub
When I run the program it doesn't give the Modules error message but another ones. Can someone help please?
|
|
|
|
|
Where is the variable or method sendWeightRequest ? In the first reference you are using the name as a method, and in the second as a property. So which is it?
|
|
|
|
|
Function sendWeightRequest()
If weightRequested = "ERROR" Then
Return ("CANNOT READ WEIGHT...")
Else
Return weightRequested
Try
scale_scannerPort.WriteLine("S334" & vbCr)
Catch ex As Exception
End Try
End If
End Function
Hope this answers your question. On my laptop I get an error at 'Catch ex ...'which reads: ' Unused local variable: 'ex'.', but on my DT I don't get that error and I'm using the same versions of VB on both machines.
|
|
|
|
|
Yes that answers your previous question, but you are still using the wrong syntax in your call to MessageBox.Show . As to the error above, you are attempting to catch an exception but you never use the ex variable. However, it does not really matter since you will never get to that Try/Catch block in the firstplace.
|
|
|
|
|
Which kind of Datatype do you get from SendWeightRequest ?
If it isn't a string you first have to convert it into String. Messagebox want to get a String as Message. So please try :
MessageBox.Show(sendWeightRequest.toString)
|
|
|
|
|
Hi.
I've tried it but it gives the same error message.
|
|
|
|
|
OK ... once again :
Which kind of Datatype do you get from SendWeightRequest(-Function) ?
|
|
|
|
|
|
OK ... what is the real return-value from your Function "SendWeightRequest" ? You could see it in the Debugger-Mode.
But ... perhaps you should better offer/provide the code of the Function "SendWeightRequest" ...
|
|
|
|
|
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
|
|
|
|