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
A

Ammar_Ahmad

@Ammar_Ahmad
About
Posts
38
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Format json file (read and processing it)
    A Ammar_Ahmad

    I have been working on a minecraft (game) launcher and so far everything is going good. But I want it to do something more.. like install different versions. The way the official launcher does it by reading the .json file. Here is an example of one of the json file:

    {
    "id": "1.6.4",
    "time": "2013-09-19T20:52:37+05:00",
    "releaseTime": "2013-09-19T20:52:37+05:00",
    "type": "release",
    "minecraftArguments": "--username ${auth_player_name} --session ${auth_session} --version ${version_name} --gameDir ${game_directory} --assetsDir ${game_assets}",
    "libraries": [
    {
    "name": "net.sf.jopt-simple:jopt-simple:4.5"
    },
    {
    "name": "com.paulscode:codecjorbis:20101023"
    },
    {
    "name": "com.paulscode:codecwav:20101023"
    },
    {
    "name": "com.paulscode:libraryjavasound:20101123"
    },
    {
    "name": "com.paulscode:librarylwjglopenal:20100824"
    },
    {
    "name": "com.paulscode:soundsystem:20120107"
    },
    {
    "name": "argo:argo:2.25_fixed"
    },
    {
    "name": "org.bouncycastle:bcprov-jdk15on:1.47"
    },
    {
    "name": "com.google.guava:guava:14.0"
    },
    {
    "name": "org.apache.commons:commons-lang3:3.1"
    },
    {
    "name": "commons-io:commons-io:2.4"
    },
    {
    "name": "net.java.jinput:jinput:2.0.5"
    },
    {
    "name": "net.java.jutils:jutils:1.0.0"
    },
    {
    "name": "com.google.code.gson:gson:2.2.2"
    },
    {
    "name": "org.lwjgl.lwjgl:lwjgl:2.9.0",
    "rules": [
    {
    "action": "allow"
    },
    {
    "action": "disallow",
    "os": {
    "name": "osx",
    "version": "^10\\.5\\.\\d$"
    }
    }
    ]
    },
    {
    "name": "org.lwjgl.lwjgl:lwjgl_util:2.9.0",
    "rules": [
    {
    "action": "allow"
    },
    {
    "action": "disallow",
    "os": {
    "name": "osx",
    "version": "^10\\.5\\.\\d$"
    }
    }
    ]
    },
    {
    "name": "org.lwjgl.lwjgl:lwjgl-platform:2.9.0",
    "rules": [
    {
    "action": "allow"
    },
    {
    "action": "disallow",
    "os": {
    "name": "osx",
    "version": "^10\\.5\\.\\d$"
    }
    }
    ],
    "natives": {
    "linux": "natives-linux",
    "windows": "natives-windows",
    "osx": "natives-osx"
    },
    "extract": {
    "exclude

    Visual Basic announcement java apache com game-dev

  • Program in a window
    A Ammar_Ahmad

    You can make a windows form view a WPF application inside of it and viceversa. Use the host wpf control to do that. Here this should also help: http://msdn.microsoft.com/en-us/library/ms751761.aspx[^]

    Visual Basic csharp tutorial

  • Event on Scrolling to the end in flowlayoutpanel
    A Ammar_Ahmad

    Alright so here is what I got so far:

    Dim WithEvents scrollhandler As MyListener 'class that will watch windows to see if your scrolling
    Private scrolled As Boolean = False 'boolean you can use to flip if a message box was displayed or not...(so it wont loop the messagebox.show)
    Private maxscroll As Int64 'int used to store the max value of the scrollbar
    ' Private index As Int32 = 0 'used for random loops to fill the txtscroll
    Private Const SB_HORZ As Integer = &H0
    Private Const SB_VERT As Integer = &H1

    'dll used to get the scrollbar value NOTE: if the scrollbar is not visible or you go higher then your max it will crash!
     \_
    Public Shared Function GetScrollPos(ByVal hWnd As IntPtr, ByVal nBar As Integer) As Integer
    End Function
    
    'dll used to set the scrollbar value NOTE: if the scrollbar is not visible or you go higher then your max it will crash!
     \_
    Private Shared Function SetScrollPos(ByVal hWnd As IntPtr, ByVal nBar As Integer, ByVal nPos As Integer, ByVal bRedraw As Boolean) As Integer
    End Function
    
    
    Public Property HScrollPos() As Integer 'property to set or get the horisontal scrollbar value
        Get
            Return GetScrollPos(DirectCast(FlowLayoutPanel1.Handle, IntPtr), SB\_HORZ) 'change txtscroll to the control you use. dont forget the .handle
        End Get
        Set(ByVal value As Integer)
            SetScrollPos(DirectCast(FlowLayoutPanel1.Handle, IntPtr), SB\_HORZ, value, True) 'change txtscroll to the control you use. dont forget the .handle
        End Set
    End Property
    
    
    Public Property VScrollPos() As Integer 'Property to set or get the Vertical scrollbar value
        Get
            Return GetScrollPos(DirectCast(FlowLayoutPanel1.Handle, IntPtr), SB\_VERT) 'change txtscroll to the control you use. dont forget the .handle
        End Get
        Set(ByVal value As Integer)
            SetScrollPos(DirectCast(FlowLayoutPanel1.Handle, IntPtr), SB\_VERT, value, True) 'change txtscroll to the control you use. dont forget the .handle
        End Set
    End Property
    
    'will add load in the end.
    
    Private Sub FlowLayoutPanel1\_MouseWheelScroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FlowLayoutPanel1.MouseWheel
        scrollhandler\_MyScroll(e, e) 'needed to catch the scrollwheel event.
    End Sub
    
    
    Private Sub scrollhandler\_MyScroll(ByVal sender As Object, ByVal
    
    Visual Basic algorithms tutorial question

  • Event on Scrolling to the end in flowlayoutpanel
    A Ammar_Ahmad

    so all the code needs to be same. but what should I do with: maxscroll = index - 18 ? the index property was giving an error in flowlayoutpanel. can you give me the example on the same code or better on the project its self.. :

    Imports System.Runtime.InteropServices

    Public Class Form1
    Dim WithEvents scrollhandler As MyListener 'class that will watch windows to see if your scrolling
    Private scrolled As Boolean = False 'boolean you can use to flip if a message box was displayed or not...(so it wont loop the messagebox.show)
    Private maxscroll As Int64 'int used to store the max value of the scrollbar
    'dll used to get the scrollbar value NOTE: if the scrollbar is not visible or you go higher then your max it will crash!
    _
    Public Shared Function GetScrollPos(ByVal hWnd As IntPtr, ByVal nBar As Integer) As Integer
    End Function

    'dll used to set the scrollbar value NOTE: if the scrollbar is not visible or you go higher then your max it will crash!
    \_
    Private Shared Function SetScrollPos(ByVal hWnd As IntPtr, ByVal nBar As Integer, ByVal nPos As Integer, ByVal bRedraw As Boolean) As Integer
    End Function
    
    Private Const SB\_HORZ As Integer = &H0
    Private Const SB\_VERT As Integer = &H1
    
    
    Public Property HScrollPos() As Integer 'property to set or get the horisontal scrollbar value
        Get
            Return GetScrollPos(DirectCast(txtscroll.Handle, IntPtr), SB\_HORZ) 'change txtscroll to the control you use. dont forget the .handle
        End Get
        Set(ByVal value As Integer)
            SetScrollPos(DirectCast(txtscroll.Handle, IntPtr), SB\_HORZ, value, True) 'change txtscroll to the control you use. dont forget the .handle
        End Set
    End Property
    
    
    Public Property VScrollPos() As Integer 'Property to set or get the Vertical scrollbar value
        Get
            Return GetScrollPos(DirectCast(txtscroll.Handle, IntPtr), SB\_VERT) 'change txtscroll to the control you use. dont forget the .handle
        End Get
        Set(ByVal value As Integer)
            SetScrollPos(DirectCast(txtscroll.Handle, IntPtr), SB\_VERT, value, True) 'change txtscroll to the control you use. dont forget the .handle
        End Set
    End Property
    
    Private Sub Form1\_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'some random loop i used to ditch some data in my listbox for testing
    
    Visual Basic algorithms tutorial question

  • Event on Scrolling to the end in flowlayoutpanel
    A Ammar_Ahmad

    Err my laptops fan got fried - is at the repair shop. - sorry for the late reply... Anyway. So you mean I should just call this function on load? and replace the maxscroll = index - 18 on load?

    Visual Basic algorithms tutorial question

  • Event on Scrolling to the end in flowlayoutpanel
    A Ammar_Ahmad

    huh? Sorry but I didn't quiet get that... wasn't quiet good in maths :/ Can you check into the source code: http://www.mediafire.com/?m13i05h0vmb11yc[^] I actually want this to be on Flowlayoutpanel1.

    Visual Basic algorithms tutorial question

  • Event on Scrolling to the end in flowlayoutpanel
    A Ammar_Ahmad

    Oh that kinda worked... but how am I ganna calculate the value in a control like this one: When its normal screen size: http://foto.pk/images/minx.png[^] When its maximized: http://foto.pk/images/maxx.png[^] ------------------------------------------------------------- Btw. You asked why would I want to know this value before... Answer) I don't actually want to show users "yay u reached the bottom" lol. I want the program to get more tweets when it reaches there. The above that I am making is a v2 of my current twitter client called TRocket. TRocket - Twitter Client [Open Source][^]

    Visual Basic algorithms tutorial question

  • Event on Scrolling to the end in flowlayoutpanel
    A Ammar_Ahmad

    Did you test the code...? Well... Because the above didn't work for me. I made a test project to see how it works. but it didn't show me any message...

    Visual Basic algorithms tutorial question

  • Event on Scrolling to the end in flowlayoutpanel
    A Ammar_Ahmad

    Seems like I misunderstood the algorithm.

    Visual Basic algorithms tutorial question

  • Event on Scrolling to the end in flowlayoutpanel
    A Ammar_Ahmad

    isn't previousValue a readonly value?

    Visual Basic algorithms tutorial question

  • Event on Scrolling to the end in flowlayoutpanel
    A Ammar_Ahmad

    Thanks for the example. but I still can't figure out how I can use this to know if the user has scrolled to the end.

    Visual Basic algorithms tutorial question

  • Event on Scrolling to the end in flowlayoutpanel
    A Ammar_Ahmad

    yeah but this still causes the issue of 100x message boxes that are displayed when I use the bar instead of the arrows. Edit: And the issue of back scroll is still there..

    Visual Basic algorithms tutorial question

  • Event on Scrolling to the end in flowlayoutpanel
    A Ammar_Ahmad

    So I tried to do something like that today.

        If e.NewValue = e.OldValue Then
            MsgBox("hi")
        End If
    

    but it is not working the way I want it to work... The problem is that now if I click the arrows on the scroll bar, then only it works, if I use the (bar) *not the left/top right/bottom arrows, it shows the message box like 100x times. but even then I am having a problem. the problem is that, when I scroll back to the beginning, it shows that message box again.

    Visual Basic algorithms tutorial question

  • Event on Scrolling to the end in flowlayoutpanel
    A Ammar_Ahmad

    Is there a way that I can fire an event when the user scrolls to the end of the flowlayoutpanel? if so then can you please tell how to do it? just a quick note: I am using the autoscroll/horizontal scrollbar. Algorithm: If scroll.value = endofthispage then msgbox("You are at the end of this page") else 'do nothing end if

    Visual Basic algorithms tutorial question

  • Cannot change text of button on a control.
    A Ammar_Ahmad

    Thanks Nick. But the issue has already been resolved :)

    Visual Basic

  • Cannot change text of button on a control.
    A Ammar_Ahmad

    That worked beautifully :D BIG THANKS M8!

    Visual Basic

  • Cannot change text of button on a control.
    A Ammar_Ahmad

    nope. not working.

    Visual Basic

  • Cannot change text of button on a control.
    A Ammar_Ahmad

    It is there... it should be under Form1. This is Twitter client that I am working on.

    Visual Basic

  • Cannot change text of button on a control.
    A Ammar_Ahmad

    Still doesn't work.

    Visual Basic

  • Cannot change text of button on a control.
    A Ammar_Ahmad

    Alright. So here is the exact issue with all the pictures and everything. I have a Form which has a FlowLayoutPanel, which has a UserControl on it. That Usercontrol has a Button on it. The initial text of that Button is "0" But I want to change that to "1" if it is a "0" and change it back to "0" if it is a "1" So this is the code I used on the UserControl which has the Button on it:

    Public Class UserControl1

    Private Sub Button1\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Button1.Text = "0" Then
            Button1.Text = "1"
        ElseIf Button1.Text = "1" Then
            Button1.Text = "0"
        End If
    End Sub
    

    End Class

    But when I click on Button1, the event does get fired but the text of the Button1, that is on the UserControl which is drawn on FlowLayoutPanel doesn't get changed.

    Visual Basic
  • Login

  • Don't have an account? Register

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