|
hey there
I got a visual basic 2008 express version
but the 'Target CPU' option isn't where you said it should be..
anybody know what could be the cause of that?
Thanks
Empathies
|
|
|
|
|
That's because it isn't there in the Express Editions. There is no 64-bit compiler support in the Express Editions, therefore you won't get the option to limit the compiler to 32-bit only code. It's already 32-bit only.
|
|
|
|
|
|
I have same issue but the advanced tab is not available it is there but disabled?
|
|
|
|
|
What version of Visual Studio are you using? Perhaps that feature is not available in the Express version?
|
|
|
|
|
Sorry for the vague title, I guess creativity in describing issues is not my forte.
Brief summary, I have made a Menu control for an application that functions as intended. The menu control has a hierarchy of other controls which is somewhat to complex, but has a great deal of controls. I receive a data table which my menu uses as a data source to add controls to compose the menu of the application, however it takes a great deal of time to construct and there is an issue with drawing. All my controls are in a single FlowLayoutPanel within my Menu control.
The issue is, the order in which I add controls within the FlowLayoutPanel where respected when the FlowLayoutPanel was added during design time. For the issues stated above, I moved my FlowLayoutPanel to be created during run-time, in hopes that my drawing issues will go away if I add all my controls to the FlowLayoutPanel, and then to the Menu control.
For some reason, now the respect in which controls where added to the FlowLayoutPanel are no longer respected, so the ordering of controls are lost. I've debugged all my loops and recursion methods and they are added in the correct order, but the Controls.Item(i to Max) do not list them in that same order.
Is there a reason why, if no algorithms to add the controls where changed, why the FlowLayoutPanel would incorrectly order controls if it placed during design-time over run-time? Why would this behavior change during design time?
If any clarification is needed, please ask.
An example of code is posted below...
first instance of adding a control to the ControlArea of type System.Windows.Forms.ControlLayoutPanel
Me.ControlArea.Controls.Add(MenuButton1)
AddHandler MenuButton1.Click, AddressOf MenuButtonClicked
HeaderLayoutPanel = New System.Windows.Forms.FlowLayoutPanel
HeaderLayoutPanel.Anchor = Windows.Forms.AnchorStyles.Left And Windows.Forms.AnchorStyles.Top And Windows.Forms.AnchorStyles.Right
HeaderLayoutPanel.Width = Me.Width
HeaderLayoutPanel.Height = 0
HeaderLayoutPanel.Margin = New System.Windows.Forms.Padding(0, 0, 0, 0)
HeaderLayoutPanel.Tag = MenuButton1.Tag
second instance
Me.ControlArea.Controls.Add(HeaderLayoutPanel)
Then I have a loop to add a MenuButton, and immediately underneath another FlowLayoutPanel which holds other controls etc.
But in the FlowLayoutPanel, it orders all MenuButtons followed by all FlowLayoutPanels, not respecting the order they where added in.
Any insight is appreciated.
Thank you for the time and the read.
|
|
|
|
|
Hi EliottA,
I have no experience with FlowLayoutPanel, but I have a gut feeling, if I were a FlowLayoutPanel, I wouldn't like my height being set to zero...
|
|
|
|
|
The height is sized accordingly, sorry for leaving the detail out.
All the controls are shown, just not in the order that they where added. The general order is MenuButton followed by a FlowLayoutPanel who's visibility is set to false. When you click that MenuButton, the FlowLayoutPanel's visibility is toggled.
The issue is, despite the way I've added my controls, the z-order index appears to be out of whack and the FlowLayoutPanel is reordering them by itself (See similar issue[^]), also been reported to Microsoft Bug 434674 here[^].
Thanks for the quick reply Luc, it is appreciated.
|
|
|
|
|
The first link you provided makes it smell like a bug indeed. You could study the matter using reflector...
|
|
|
|
|
On my own time, maybe.
A quick and dirty workaround was to make the FlowLayoutPanel visible while I was populating it while it's parent container (the Menu control itself) was invisible. Then swap each and order was preserved nicely. On company time, this will do for now but I'm interested to go through it on my own time using reflector to see why this odd behavior exists.
Thanks again Luc.
|
|
|
|
|
I've been trying to get a picture of a window by getting it's device context and blitting it onto a graphics object. This all works fine and I can see the image on a picturebox, but some weird things happen sometimes.
Sometimes I get windows without a title bar, and it seems to not like maximized windows very much. Also, for some reason, once it has gotten the image for a window, whatever was behind the window's glass the first time, will stay there no matter what until I restart it (my program).
I've properly released the DC afterwards so I don't know what could be causing this.
Have you tried the Krypton Toolkit? http://www.componentfactory.com/free-windows-forms-controls.php
|
|
|
|
|
Hey,
I need to access the CByte function from C#
I've referenced the Microsoft.VisualBasic .Net Component but I can't figure out how to access the CByte function.
I understand doing this is very strange, I have my strange reasons. Properly converting it to c# is plan b, at the moment if it's easy to access the CByte function i'd much rather do that.
Thank you
|
|
|
|
|
I suppose you could just make a quick 'wrapper' dll in visual basic that encapsulates the function for you and reference that in your program.
Have you tried the Krypton Toolkit? http://www.componentfactory.com/free-windows-forms-controls.php
|
|
|
|
|
I don't think you can. I would imagine the function would be something like this in C# - or you can modify this to work as required:
public static byte CByte(object expression)
{
byte result = 0;
if (expression is IConvertible)
{
try
{
result = Convert.ToByte(expression);
}
catch
{
}
}
return result;
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
What's wrong with using Convert.ToByte()???
No jumping through hoops, no VisualBasic namespace, just a conversion...
|
|
|
|
|
This is the best solution.
Note that "CByte" and the other related ones (CInt, CStr, etc.) are operators in VB and are not methods in any library, so you have to use something else, such as Convert.ToByte as recommended by Dave K.
David Anton
http://www.tangiblesoftwaresolutions.com
Convert VB to C#, C++, or Java
Convert C# to VB, C++, or Java
Convert C++ to C#, VB, or Java
Convert Java to C#, C++, or VB
|
|
|
|
|
Hi
Is there any way of capturing a link click event from a DataGridViewLinkCell?
I'm starting to think that this column's only purpose is to underline text...
Anyway, any help is apreciated
Thanks
|
|
|
|
|
Take a look at this answer to a similar problem[^], substitute LinkLabel for CheckBox and use the event of your choice.
I have never used a LinkLabel , so cannot help on that part of it.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
im programming a tournament draw system in vb .net, which is an elimination system. i have completed all other modules in this project, now i need to make the draw. As there is an underlying points system, i need to record the byes, which do not score, and wins, which score 1 point.
so, if there are 5 entrants [a,b,c,d,e] in a particular division, the first round would be:
[a,b]
[c,d]
e
where b and c win, and e receives a bye. the second round would be:
b
[c,e]
where b now receives the bye. after this there would be 1 more round; a total of 3 rounds, 2 byes and 4 matches
how can i do this programmatically? i cant find a suitable pattern to follow or any useful info on google
has anyone made something similar? is there some keyword that i should search for?
i do realise that i havent supplied any actual code, but i dont have any to attach that would prove relevant
thanks,
-n
|
|
|
|
|
Your question interested me, so I did a bit of searching. It is incredibly difficult to find a search term that gives any meaningful results, however I did find this[^].
I hope it is of some help.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks for the link,
"Bayesian locally optimal design of knockout tournaments" is what i got from that article. After a bit of searching i found a report which mentioned phantom players, just adding these to fill a division up to a power of 2
thanks again
-N
|
|
|
|
|
Hi,
I have created a form which I need to draw a triangle in it.
I found a block of code in internet like this:
Dim Graph As Graphics
Dim Ps() As Point
Graph = Graphics.FromHwnd(hwnd:=ActiveForm().Handle)
ReDim Ps(2)
Ps(0) = New Point(150, 25)
Ps(1) = New Point(150, 125)
Ps(2) = New Point(350, 125)
Graph.DrawPolygon(pen:=New Pen(Color.Black, Width:=1), points:=Ps)
it is in paint event of form,
it works when I load it by itself, but when I try to load it in a mdiParent form
the triangle doesn't show up,
can any one help me?
also I'm new to vb.net so if there is a better way to draw things please tell me
Thanks in advance
|
|
|
|
|
Actually I changed
Graph = Graphics.FromHwnd(hwnd:=ActiveForm().Handle)
to
Graph = Graphics.FromHwnd(hwnd:=Me.Handle)
and it works
I just need to know what ' := ' does
like
Width := 1
|
|
|
|
|
":=" sets parameters being passed to a method by name instead of relying on the order of parameters.
You REALLY should be doing your form painting in its Paint event instead of creating your own Graphics object.
|
|
|
|
|
assuming arrival method is still executing after say 40s seconds . how can i prevent the service from calling another instance pf arrival method
Public Class intestService
Protected Overrides Sub OnStart(ByVal args() As String)
Dim tDelegate As Threading.TimerCallback = AddressOf Arrival
oTimer = New System.Threading.Timer(tDelegate, Me, 10, 40)
End Sub
Public Sub Arrival(ByVal sender As Object)
'File.AppendAllText("C:\test4.txt", "AuthorLogService fires arrival at " & Now.ToString())
Try
'
Catch ex As Exception
log.WriteEntry(ex.Message, EventLogEntryType.Error)
End Try
End Sub
Protected Overrides Sub OnStop()
' Add code here to perform any tear-down necessary to stop your service.
End Sub
End Class
|
|
|
|
|