Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
T

Tino Fourie

@Tino Fourie
About
Posts
11
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Algorithms to Visual Basic Code
    T Tino Fourie

    This is a 15 year old student who gets 100% for maths. I did so bad at maths, my school ran out of Armenian alphabet letters to try and give me a grade. (If I remember correctly, the old Armenian alphabet consisted of 65 letters) What allows me to code is my cunning ability to read and write and my best friend is Google.

    Visual Basic css sales help

  • Copy selected listview item to a textbox VB.NET
    T Tino Fourie

    txtITEM.Text, +"." + ".txt", False

    What's wrong there ? You can't have a "+" next to a ","

    Visual Basic help csharp database question

  • More than 1 barcode reader in one pc
    T Tino Fourie

    Not sure but maybe this link could help you.http://social.msdn.microsoft.com/Forums/vstudio/en-US/72bdcb78-24aa-4641-a7a6-6225b101e748/visual-basic-usb-control[^]

    Visual Basic csharp help tutorial

  • graphics quality very poor, how to improve?
    T Tino Fourie

    An image with a dimension of 48x48 literally means that you have an image consisting of 48 * 48 pixels. If you load that image into a control with an Image property, and the said control's dimension are bigger than that of the image itself, the image will be stretched (zoomed) to fit the dimension of the control. However, in a Picturebox you can control how an image is displayed - zoomed, stretched, centered, etc. As mentioned before, try and use a higher resolution image. Higher resolution means a higher number of pixels. That will give you an image file with a greater dimension. The control you are using the display the image (other than a picturebox) will fit the image according to its own dimensions and not that of the image. Make sure that the control's dimensions are relative to that of the image to prevent the image from being distorted.

    Graphics graphics tutorial question code-review

  • graphics quality very poor, how to improve?
    T Tino Fourie

    I did not find in the OP's question that he / she was having general problems with the quality of his / her display. The OP made it very clear that when he / she loads an image with a 48x48 dimension that the image he / she loaded was of poor quality. It is important that you understand the question before you post an absurd reply like you have just did. You should be ashamed of yourself.

    Graphics graphics tutorial question code-review

  • is it possible to sample my screen?
    T Tino Fourie

    There are two ways of doing this through a single process called a SnapShot. 1. You can capture your entire display area, or 2. by defining a rectangular area on the display area called the ROI (Region Of Interest) There are lots of code samples out there that covers both scenarios. Use Google to search for "How to take a snapshot of my display" or "How to capture an area of my screen". You can then save the memory stream (the captured information will be stored in a memory stream) in a few formats - JPG, TIFF, PNG and BMP.

    .NET (Core and Framework) performance question

  • Help... Again...
    T Tino Fourie

    Not entirely sure what Language you are using here but it looks very much like VB. Therefore assuming that it is VB. On the surface your code looks correct. If I had to rewrite the code it would look something like this:

    Module Module1

    Dim distance As Decimal = 0
    Dim answer As String = nothing

    Sub Main()
    Console.WriteLine("Do you want to convert miles or kilometers? (M or K)")
    answer = Console.ReadLine()

    Console.WriteLine("What is the distance?")
    distance = Console.ReadLine()

    If answer = "M" Then
    Console.WriteLine("The converted value is: " convertToKM(distance))
    Else
    Console.WriteLine("The converted value is: " & converToML(distance))
    End If

    Console.ReadLine()
    End Sub

    Function convertToKM(distance) As Decimal
    Dim km as Decimal = 0

    km = distance / 0.62137
    Return km
    End Function

    Function convertToML(distance) As Decimal
    Dim ml as Decimal = 0

    ml = distance * 0.62137
    Return ml
    End Function

    End Module

    Visual Basic help tutorial question

  • Changing backcolor of a textbox
    T Tino Fourie

    If it does not affect your program execution then probably no. However each event serves a specific purpose and should maybe treated as that. Edit: I just had a quick look at your suggestion and there is absolutely nothing wrong with what you suggested. The upside of that is it reduces the amount for coded lines and since there are 6 textboxes why on earth would I want to navigate past 5 identical Sub's each referring to another similar control. You probably got down voted by a noob who does not really know what all that means.

    Visual Basic csharp com question

  • Add Multiple Records to one TextBox from SQL
    T Tino Fourie

    Late but might still help. I am going to assume a few things and then also use code as an example to simplify the possible solution. Assumptions: In your DB you probably have a table for Members and another table for EmailMsg (to be distributed to Members) 'Lets assume all Members Your SQL query will be

    "SELECT * FROM DB.Members"

    'Lets assume Email based on Subject Your SQL query will be

    "Select * FROM DB.MailMsg WHERE Subject = 'How do I'"

    Run the first query against the database to get all the Members and populate your dataset (DBData) Now populate the "MailTo" textbox:

    For i = 0 to DBData.rows - 1
    MailTo.AppendText(DBData.rows(i).Item(0) & ";")

    Instead of the AppendText option, you can use the "ScrollToCaret" option, but I much prefer the AppendToText option. To populate the the "Subject" textbox and "EmailMessage" textbox is done exactly the same except you do not need to iterate through the dataset because there should only be one EmailMsg in there. You might want to use the Multiline option in your textbox containing the mail message you wish to distribute. Good luck and try to stay away from automated Wizards, they really don't teach you anything good.

    Regards, Tino "Plan your work, Work your plan"

    Visual Basic database help csharp sql-server

  • 1 form, 2 text boxes, how to write code to exchange text between boxes
    T Tino Fourie

    This might be a little late but still good for educational value. All the suggestions are perfectly correct and easy to read when inspecting the code. However there is one other way of doing this without declaring any additional variables like:

    Dim txtA as string 'Stores the text of TextBoxA
    Dim txtB as string 'Stores the text of TextBoxB

    Each control has a "Tag" property that you can use to store any type of text. Therefore you can write the following code without declaring any additional variables. In your "Form_Load"

    txtA.Tag = txtA.text 'Copy text to Tag
    txtB.Tag = txtB.text 'Copy text to Tag

    In the Button_Click event of the Swop Button you write:

    txtA.text = txtB.Tag
    txtB.text = txtB.Tag

    The "Tag" property has many uses, this is but one possible use to keep from declaring too many variables for silly little tasks while you have other places to store relevant data.

    Regard, Tino "Plan your work, Work your plan"

    Visual Basic help tutorial question

  • How to access a number of dynamically created user controls
    T Tino Fourie

    I have two User Controls, _ucDateListing and _ucImageListing. In my main form I declare ucDateListing: Private ucDateListing as New _ucDateListing ucDateListing has two controls - a DataGridView (dgvDates) and a Panel (pnlImages). I then dynamically add this control to a panel control on the main form. I populate the DGV with data from a DB. For every date (no duplicates), for every row in other words, I add ucImageListing control to the ucDateListing.pnlImages panel.

    'Define a new _ucConsultationImages control
    Dim ucImageListing As New _ucImageListing

                'Set the properties of the control before adding it
                With ucImageListing
                    .Location = New Point(0, 0)
                    .Dock = DockStyle.Fill
                    .Tag = DBData.Rows(i).Item(0) 'Date used to identify control
                    .Visible = False
                End With
    
                'Add the ImageListing control to the DateListing control on the main form
                frmMain1.ucDateListing.pnlImageListing.Controls.Add(ucImagesListing)
    

    My question is, how do I access each of these user controls individually every time I select a date in the DGV. I am currently looping through all the added controls and test the .Tag field to the selected date from the DGV. All that works fine.

    'Get ucImageListing that corresponds to selected date in DGV
    For Each ctrlImageListing As Control In pnlImageListing.Controls
    If TypeOf ctrlImageListing Is _ucImageListing Then
    If ctrlImageListing.Tag.ToString = dgvDates.Rows(dgvDates.CurrentRow.Index).Cells(0).Value.ToString Then
    ctrlImageListing.Visible = True
    Exit For
    End If
    End If
    Next

    Now that I have found the control, how do I access it when I need to for example load images into the Listview (lvImages) of that specific dynamically added control ? Update: Here is the solution to my own problem: I managed to figure it out, eventually. By adding the following code just before I "Exit" the For Each loop, allows me to access the "found" control like any other predefined control.

    Dim Imagelst As _ucImageList
    Imagelst = ctrlImagesList

    With Imagelst
       .lvImageListing.Height = 20 'Test to see if I can resize the listview in the user control
    End With
    

    There are probably other sex

    Visual Basic question database tutorial winforms help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups