15,886,003 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by F. Xaver (Top 82 by date)
F. Xaver
22-Feb-18 5:12am
View
why the hell, limit password to max 12 Chars .. so my ubarsecurity 30char pw won't work with your app..
F. Xaver
9-Nov-17 9:58am
View
Thank you ;)
F. Xaver
8-Nov-17 6:19am
View
so MyTime.ToString("o") gives the right timezone offset, or just a "Z" at the end? (on dev server)
F. Xaver
8-Nov-17 5:59am
View
yeha like Peter sayd.. what value is 'Mytime' sure it is in local time zone on dev server?
and why search UTC ....
TimeZoneInfo.ConvertTimeToUtc(MyTime)
F. Xaver
3-Jul-17 3:06am
View
you can still call a and b with buttons... that call was just an example for that variable, not loosing its data.
F. Xaver
28-Jun-17 5:09am
View
use the debuger to watch what is getting set..
what have you used to fill the listbox? (listbox1 is allways a terrible name btw)
System.IO.Ports.SerialPort.GetPortNames to get the actual present devices?
from a fast look it should work fine.. but if you not block the listbox after that, or close and freeing the comport befor a new selection you will pretty sure get errors.
(and as your comments say.. some of those settings are kinda uncommon. I've never seen a device with .Parity = Space so far
F. Xaver
1-Mar-17 10:22am
View
Why so much possibility's anyway.. there are only 22 Country's with more than 1 time zone
most apps only add some of the bigger city's or only the capital-city to the country name
like 'Afghanistan (Kabul),.., France (Paris),.., Germany (Berlin),.. Zimbabwe (Harare)
and for that 22 country's ... like USA
USA /HAST (Honolulu), USA /AKST (Anchorange), USA /PST (Los Angeles), USA /MST (Salt Lake City), USA /CST (Chicago), USA /EST (New York)
why go more into detail ;)
F. Xaver
22-Feb-17 10:04am
View
yeha true, didn't think of that possibility, Added s sample ;)
F. Xaver
19-Jan-17 7:09am
View
.First will throw an Exception if there is no Fruit with that Name, so -1 is never returned
F. Xaver
16-Jan-17 10:23am
View
I'm not familiar with EntityFramework :(
maybee change postatus from Structure to Class with an empty Sub New() might help.. but as said, I don't use Entity
but I see 2 options for you
- Change GetPOStatusByLinQ to only return one postatus object
- Or change wherever you use GetPOStatusByLinQ that it support a List(Of postatus) (only if Class idea works)
F. Xaver
16-Jan-17 7:20am
View
debbuging means that you have to do the work yourself ;)
F. Xaver
13-Jan-17 5:21am
View
5fed, coz I see no reason why this has 2 1Star votes..
F. Xaver
9-Jan-17 9:44am
View
but but .. words ... hurt .. soo muuuuch
;)
F. Xaver
9-Jan-17 3:04am
View
.Replace("Mom","Dad").Replace("Dad","Mom") incoming ^^
F. Xaver
13-Dec-16 5:50am
View
5ed
F. Xaver
13-Dec-16 5:49am
View
5ed
F. Xaver
7-Dec-16 10:06am
View
yeah. Some nice written LINQ one liner, slow as hell compared to a 10 liner For-loop iterating through the same collection.
If performance is necessary, better not use LINQ to much (or any)!
Anyway I rely like to use it when there is no need for performance/speed
F. Xaver
2-Dec-16 3:14am
View
I'd +5 that ^^
F. Xaver
1-Dec-16 6:27am
View
I like such tutorials ... its vulnerable for sql-injection
F. Xaver
6-Sep-16 12:14pm
View
I updated my Solution
F. Xaver
25-May-16 7:18am
View
but not initialised ...
Set oSheet = oBook.Worksheets(1)
for example
F. Xaver
22-Mar-16 3:41am
View
IsNot is comparing object references, not the Object it self.
I'm pretty sure you better go with '<>' operator
F. Xaver
8-Mar-16 8:43am
View
5ed!
F. Xaver
24-Feb-16 3:21am
View
5ed
F. Xaver
11-Feb-16 6:53am
View
5ed
F. Xaver
3-Feb-16 5:23am
View
well, we can't help you with that.
how should we know where to place the commas. you provided no reasonable infos for that.
F. Xaver
1-Feb-16 3:22am
View
I don't get your method call thing, maybe get us a example?
but speaking of short code: If a <= 20 Then c+= 1
F. Xaver
22-Jan-16 3:07am
View
haha, 5ed, because I laughed ;)
F. Xaver
21-Jan-16 10:43am
View
a mix of both may bee a good idea, 75 copy & paste like lines aren't that good lookin ;)
F. Xaver
21-Jan-16 10:09am
View
without ByRef for Param2 VB.Net won't copy the data back to Param2
Public Overridable Function TestFunc(ByRef Param1 As Integer, ByRef Param2 As Object, Param3 As Integer) As Integer
F. Xaver
21-Jan-16 3:16am
View
what is your VB.Net definition of TestFunc call? maybee just need to set Param2 as ByRef
F. Xaver
20-Jan-16 18:04pm
View
Thank you
F. Xaver
20-Jan-16 18:04pm
View
yup, I saw..
Thank you
F. Xaver
20-Jan-16 6:04am
View
Sorry I meant Muhammad Saddam Noor with that ;)
F. Xaver
20-Jan-16 4:59am
View
at first.. you change your array at index 0 and 1 .. and then tell BitConverter to start in the array at index 2. but again.. there is no decimal or hexadecimal value. The program saves all values in binary. its just displayed for you as decimal as this is the system we all tend to use. There is simply no Type witch displays its Data as HEX.. for that.. System.Byte.MaxValue returns 255 and not FF as its the same, just different representations as its still saved as 1111 1111 for the computer.
F. Xaver
20-Jan-16 4:49am
View
hm maybee check BitConverter.IsLittleEndian, mine is false. and BitConverter.ToInt16(new Byte[] { 0x0, 0x79 }, 0)) returns 30976 for me.
F. Xaver
11-Dec-15 5:52am
View
where is the problem? Just change the validating of that Textbox to check that the input is an valid Integer for example.
Or better, don't let the user even enter invalid characters, using KeyPress Event to not handling unwanted character inputs
F. Xaver
11-Dec-15 4:13am
View
I loled at the 2nd sentence, so +5 ;)
F. Xaver
10-Dec-15 8:58am
View
yeha.. knowing WHAT exception is thrown would be usefull ;)
F. Xaver
27-Nov-15 4:09am
View
virtual +5 :D
F. Xaver
27-Oct-15 4:26am
View
I'm working on a class that does all the sends and reads I need. but it still got some problems with it
won't give out that code.
If you have Problems I will try to answer them ;)
F. Xaver
23-Oct-15 3:02am
View
then use ACTETHERLib.ActFXENETTCP
and _FX_Ethernet.ActHostAddress
RTFM ;)
F. Xaver
13-Oct-15 10:52am
View
not that related, but
timer1.Enabled = true;
timer1.Start();
is exactly the same. ;)
you can use either one
F. Xaver
4-Sep-15 4:23am
View
you may have noticed that
* this Question is already over 3 years old
* is answered (accepted)
* python is the wrong language
* uses Sort
F. Xaver
7-Aug-15 4:50am
View
Your question isn't clear...
what do you want..
copy a file form your solution to another place? -> why not simply using File-Explorer!?
copy a file from your RUNNING App current directory -> System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) or Application.StartupPath
if you want that file to be in your build directory -> look at Properties->Advanced->Copy to Output Directory
F. Xaver
7-Aug-15 2:56am
View
thx SA ;)
F. Xaver
6-Aug-15 9:06am
View
puh, just some ideas and suggestions from me
why declaring all the rx variables as String?
you do a lot of math like actions on it, using VB6 compatibility commands (val/str/mid/len/right/left/ascw) -> get rid of them, better use the new VB.Net functions
and give that vars better Names. why 'yy' call it something like '_Target_Year'
Using something like
Dim _target_year As Integer = mydict.Where(Function(o) o.Value = mRegNo1).SingleOrDefault.Key
instead of
Dim yy As Integer = 0
For Each entry In myDict
If mRegNo1 = entry.Value Then
yy = entry.Key
End If
Next
makes debugging way easier
or
checkno1 = Trim(Str(r6))
r6 is already a String.
just use
checkno1 = r6.Trim()
Right(Trim(Str(r1)), 2)
r1.Trim.Substring(r1.Length - 2)
are all that Trims really necessary?
when you would use a integer var for all you calculations instead of a string
CStr(r1 Mod 100)
would also to the job
hm, use
Option Strict On
Option Explicit On
Option Infer Off
and get rid of the Microsoft.VisualBasic Namespace and its functions ;)
F. Xaver
6-Aug-15 6:54am
View
Depends on the values used in CalculateRegNo Method, maybe a HardwareID's witch are HEX values (like "123" on your system and "3B5" on clients) or some Input-fields not correctly validated before use
F. Xaver
11-Jun-15 6:19am
View
Neither String or Object own a 'Append' method.
Looks like rows[something] is returning a different object, like a Stringbuilder.
OP should specify 'rows' definition
F. Xaver
2-Jun-15 2:37am
View
looks like .Net .. but.. Set 'Option Strict ON'
and get rid of 'On Error Resume Next' .. thats VB6 Error handling. there are nicer things in .net ^^
F. Xaver
29-May-15 6:04am
View
.TakeWhile(item => !tocken.IsCancellationRequested)
also works fine.. but i don't know how thats written in Query form
F. Xaver
25-Sep-14 2:47am
View
you don't need that index anymore!
sender contains the Textbox itself, where the KeyPress Event occured.
Dim MyTextBox as TextBox = DirecCast(sender, TextBox)
and you have easy access..
Also.. dont use Control array anymore.. i used them alot in VB6 but nowerdays ;) why not adding a Panel to your Form where thoose 10 Textboxes are in..
you could iterate throug it with Panel1.Controls and also do nice things like disable all Textboxes with just Panel1.enabled = false
F. Xaver
18-Sep-14 4:43am
View
still, like Richard MacCutchan sayed.. you can't use < or > operators on Strings in this way..
you need your current % value and your 89% as some numeric Type.... than
dim yourListviewValue as integer = 73
if yourListviewValue < 89 then 'this will work.
F. Xaver
11-Jun-14 2:48am
View
++;
F. Xaver
15-May-14 3:19am
View
y not using the newer and comfortable MessageBox.Show()
Msgbox is vb6 compatibility
F. Xaver
30-Apr-14 6:51am
View
yeha.. guess some Code of that part that Throws the Exception won't be a bad Idea..
F. Xaver
16-Apr-14 5:55am
View
Dim t As String = "test"
Debug.Print("Message1: {0}", Mid(t, 5))
Debug.Print("Message2: {0}", t.Substring(5))
that's because Mid will return "" here.. and Substring Throws an ArgumentOutOfRangeException, because you try to access parts of the String, which aren't there.
You need to check if the full message of the hardware is allready received. There could only be a "2" from "22.7" in the buffer when sp.DataReceived fires.
F. Xaver
7-Apr-14 7:37am
View
just because you Post it again, you won't get a different answer..
we can't help you from this.
F. Xaver
2-Apr-14 8:58am
View
puh.. i deleted that file.. but it was something like this ... if you are going to use that 'GetStatus' often.. it will lag your UI....
Dim timeout As Integer = 500
Dim endTime As Date = Now.AddMilliseconds(timeout)
Do
If yourserialport.BytesToRead >= 45 Then Exit Do
If Now > endTime Then Throw New TimeoutException("Hardware didn't respond intime")
Threading.Thread.Sleep(10)
Loop While True
'do stuff..
you don't check if you really received >= 45 Bytes.. if your For goes the 100k.. without getting any Data.. you still try to access byteRead(38) and maybee there is only 0 or 10 or whatever
I guess that courses your error
F. Xaver
1-Apr-14 8:34am
View
is events_label somewhere added to Me.Controls?
i testet it like this
.Visible = True
End With
Me.Controls.Add(Me.events_label)
and it worked fine, displaying the Text with Arial, 10.
without "Me.Controls.Add(Me.events_label)" the lable isn't displayed at all.
F. Xaver
1-Apr-14 7:47am
View
That works fine for me.
you may try to add an Eventhandler for FontChanged on your linklabel, to see how often it changes..
or post some of your Code, can't say much without it
F. Xaver
1-Apr-14 6:45am
View
what have you tried so far? ..
F. Xaver
1-Apr-14 5:21am
View
there is no Visual Basic 2006 .. there was a 2005 and 2008 Version both .NET
are you sure, you don't mean Visual Basic 6.0 aka VB6 aka Visual Basic Classic
F. Xaver
27-Mar-14 7:01am
View
So, whats your error, and where do you get it?
but basicaly .. why dont you use the SerialPort.DataReceived Event? its suitable for most cases!
when you want to wait for a response of your hardware.. that 0 to 100k for loop may be a to short time for your Hardware to respond to your command.
I had Projects where i needed to use Serialport in a simmilar way.. but i wouldn't recommend doing it that way
F. Xaver
19-Mar-14 7:13am
View
Its still possible :/
F. Xaver
14-Mar-14 4:09am
View
they force you to write typesafe and less error-prone code..
see
http://support.microsoft.com/kb/311329
http://msdn.microsoft.com/library/bb384665.aspx
for more details
F. Xaver
13-Mar-14 4:26am
View
as from that deleted Comment.. i would realy recommend that you use
Option Explicit On
Option Strict On
Option Infer Off
F. Xaver
12-Mar-14 8:48am
View
I still don't get.. how your senders change Type... post that code?
hm, as you can't change the timer Interval.. hm
why not set the TextBox.Tag Property to the DateTime the countdown ends.
So you can just do a simple check on that.. like DirectCast(textbox.Tag, Date) > Now then change backgound and stop the timer
F. Xaver
27-Feb-14 3:06am
View
you can't run your SQL qry there..
AddRange want's a IEnumerable like String() or List(Of String) witch contains your Data.
You need to run that qry separately
F. Xaver
26-Feb-14 4:22am
View
Dim acList As New AutoCompleteStringCollection
acList.AddRange([Your values from database here])
TextBox1.AutoCompleteCustomSource = acList
TextBox1.AutoCompleteSource = AutoCompleteSource.CustomSource
F. Xaver
20-Feb-14 10:10am
View
IIF() is old... just use IF()
F. Xaver
25-Nov-13 10:08am
View
I wonder what "none" is?
F. Xaver
23-Oct-13 3:07am
View
yeha well.. it's your Homework, do it yourself ^^
we won't do it for you.
ask for Problems in your code! not that anybody codes for you
F. Xaver
16-Oct-13 2:32am
View
ImageLists image resulution is small (255x255 max as I Remember)
once I maded an image selector like on the webs.
I used a FlowlayoutPanel, where I added my thumbnails as Pictureboxes with my size wishes.
You can easely scroll in it or only add 10 pagewise (that need to be done in code).. and you can easely trigger your click event on a random image
F. Xaver
19-Sep-13 10:28am
View
You give something to readValue, so it wouldn't display a error, even with 'strict on'
just use
readValue = CStr(My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\ARSS", "EPV", ""))
instead ^^
so even 'If readValue <> "" Then' would work
F. Xaver
18-Sep-13 5:15am
View
CPallini is right!
just redim it once, particularly when you know the dimensions
calling it repeatedly with Preserve is really really extremly slow, especially for large Arrays.
F. Xaver
27-Aug-13 3:20am
View
as I understand you, all you need is to set te SpliterPanel.AutoScroll to True
so you can scroll the left and the right side seperated, while the other one 'freezes' is this what you mean?
(Docking a Panel in the SplitterPanels gives you eaven more options)
F. Xaver
26-Aug-13 7:51am
View
Why are you using Forms inside the Splitcontainer?
If you don't realy need this to be Forms, you could just use the normal Events of the Textbox within Form1.
If you need this to change the SplitContainers content, I would suggest using an UserControl, where you add those Events you need.
F. Xaver
6-Jun-13 10:13am
View
Dim s As String = "This is a sample"
Dim words() As String = s.Split(" "c)
For Each Word As String in words
response.Writeline(" " & Word & " ") 'or response.Write(" " & Word & " " & vbCrLf) If your 'response' doesn't have Writeline
Next
You could eaven save up that 'words()' var if you don't need it later,
just by using: For Each Word As String in s.Split(" "c)
F. Xaver
16-Apr-13 2:44am
View
please use the code tag!
F. Xaver
4-Apr-13 2:21am
View
DirectCast (Me.Controls.Find("Label" & No,True).GetValue(0),Label).Text = DirectCast (sender,TextBox).Text
that Control.Find is awsome. haven't seen in before.
but there is no need to search the source Textbox ;)
F. Xaver
28-Mar-13 9:09am
View
why you need KeyDown event?
KeyUp or KeyPress event should also work fine for your problem.
you can cancel inputs, and check if the entered value is ok.
(KeyPress don't fire on delete or backspace)
Show More