|
Hi everyone.
I´m doing an application with an MDI form, a button bar (toolstrip) and few child forms.
I made these forms of a specific size, and I want them to be that size, fixed borders, but when I opened them as MDI childs, they are enlarged, even though I set the maximum size in the size I want. If I set their size by code before opening then, the borders are resized, but the controls in it are kept as if it were larger.
One more thing, I tried 3 forms, the 3 are enlarged, but to different sizes.
Why is that, I just want my Forms the size I set them!!
Thank you!
|
|
|
|
|
Change you child forms FormBorderStyle property to FixedSingle.
|
|
|
|
|
I did that.
Anyway I found something, had to change AutoScaleMode property to None. It still changes the text size of some controls, but in can work on that.
Thank you
|
|
|
|
|
PabloGM wrote: I did that.
And?? It works fine for me. Everything stays the exact same size as when it was defined in the Designer.
|
|
|
|
|
The onlt way I can replicate what you're describing is to set the Size property of the form on creation, resetting what was done in the designer.
Quite literally, all i did to get it to work was create an MDIParent form and a child form. Set the child forms border style, have to code create about 10 cihld forms at runtime. Worked as expected. There was no change in the size of the forms and no way to resize them.
|
|
|
|
|
It didn't work for me just by setting te border style. I had to set the AutoScale to none.
But it's working fine now.
Thank you anyway.
|
|
|
|
|
VBA.
Ive a program wrote with a few sub's and functions, it all works fine but i need to call 1 of the subroutine's every x minutes
its more complicated than that tho...
If the user selects 15 mins, then the sub has to run once every 15 mins, but it has to run on minute 0, 15, 30, 45. If they select 30 mins the sub needs to run on 0 and 30, if they select 10 mins it has to run on 0, 10, 20, 30, 40 and 50, if they select any number of mins at all(from 1 to 60), the program has to work out when to run the sub and then run it at those times.
furthermore, If i select 10mins, it cant just start and run at like 3, 13, 23, 33, 43, it must run at 0, 10, 20, 30, 40, 50, note that it doesnt need to wait till 0 to begin, if the time is currently at 14 mins it can start at 20
|
|
|
|
|
this is on way (probably not the best but...)
put a timer on the form with as interval the smallest amount the user can give in (probably 1min)
in the timer_tick event put the following
'getting the current minute
dim d as double = date.now.minute
d = d/15 'userinput of minutes goes here
dim s as string = d
'check to see if s contains a ',' or '.' (depends on the regional settings I think)
if not s.contains(",") andalso not s.contains(".") then
'do whatever you want to happen
end if
why the check for ',' or '.' well if you do the calculation from the minutes / interval the result has to be an even number if its not then it's not time yet
example :
with 15
20/15=1,333333333...
30/15=2
40/15=2,666666...
with 6
35/6=5,833333....
12/6=2
46/67,66666...
you get the point right
hope it helps
ps: this is .net code so you might need to change it a bit
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
TDDragon wrote: dim d as double = date.now.minute
d = d/15 'userinput of minutes goes here
dim s as string = d
'check to see if s contains a ',' or '.' (depends on the regional settings I think)
if not s.contains(",") andalso not s.contains(".") then
'do whatever you want to happen
end if
What on earth is this garbage??
All you need to do is see if the number of minutes in the current time is a multiple of a given number! Why are you looking at strings and digging out punctuation?? It's simple math!
If currentTimeMinutes Mod selectedInterval = 0 Then
' launch function
End If
|
|
|
|
|
right sorry it's been a long day brain wasn't working to good anymore
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistaks.
|
|
|
|
|
There are two things required. A Timer control, set for about 1 minute (60000 milliseconds), and some very simple math. In the timer event, all you do is get the current time, look at the minutes property and see if it is a nice even multiple of the number of minutes your user has selected.
|
|
|
|
|
'mnPulse is a module level var
Static dtLastTick As Date = DateAdd(DateInterval.Minute, mnPulse * -1, Now)
If DateDiff(DateInterval.Minute, dtLastTick, Now) >= mnPulse Then
If Now.Minute Mod mnPulse = 0 Then
'Do your thing here
dtLastTick = Now
End If
End If
Hope this helps.
|
|
|
|
|
srone wrote:
'mnPulse is a module level var
Static dtLastTick As Date = DateAdd(DateInterval.Minute, mnPulse * -1, Now)
If DateDiff(DateInterval.Minute, dtLastTick, Now) >= mnPulse Then
If Now.Minute Mod mnPulse = 0 Then
'Do your thing here
dtLastTick = Now
End If
End If
What's with all the extra junk in bold?? You might want to re-read to OP's requirements. YOu're making it much harder than it needs to be.
|
|
|
|
|
You're correct, all he needs is
If Now.Minute Mod mnPulse = 0 Then
'Do your thing here
End If
with a timer.interval set to 60000.
If he wants the event to happen at 10:00 he will need all the rest with the interval set to 1000.
Not my first attempt at over engineering something.
|
|
|
|
|
consistently using bold for junk seems like a very good idea...
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thanks for all your help and suggestions, the final code looks like this:
<code>
Sub PrintData()
Dim Interval As Integer
Dim n1 As Integer
Dim n2 As Integer
Interval = User_Log_Interval
n1 = Format(Now, "nn") 'Current Minute
n2 = Interval 'Interval
If (n1 Mod n2)= 0 Then
'Run Script
Else
'Dont Run Script
End If
End Sub</code>
|
|
|
|
|
after some more testing, "If (n1 Mod n2)= 0 Then" doesnt allow the current minute to be 00, and it doesnt allow the interval to be 0 or 1, i change it to the following code and all seems well "If Int(n1 / n2) = n1 / n2 Then"
|
|
|
|
|
Since the "question" you're asking is so broad, it tells me that you don't have any idea what you're talking about.
remkarggg wrote: should i be aware of the username and passwords?
This would be dictated soley by the Telnet Server you're trying to connect to. Noone here can tell you what you should be looking for. Generally, yes, the server will possibly ask you for a username and password.
remkarggg wrote: how to connect a telnet server with source code,
User a third party library, like this[^].
remkarggg wrote: how things aplly wen connecting
If you don't already understand the TCP/IP connect process, you're not going to understand it with a couple of forum posts. This is a subject that normally takes an entire set of chapters in a book to explain.
|
|
|
|
|
You're best source of information on using a third party library is going to be the manufacturer of the library. I've never heard of Jscape, of this telnet library, so I can't give you a definitive answer.
You paid the money for the library, ask the people who wrote it how to use it. I'm pretty sure it came with documentation on the basics of using it.
But, in general, you add a reference to the DLL file supplying the classes you want to use. THen you import the namespaces those classes are in at the top of the code you want to use them in. For example (don't even think of copy'n'pasting this into your code):
Imports Jscape.Telnet
Now, I have no idea what the namespaces are in that library, so this code will most likely NOT work. That's what the documentation you paid for is for.
|
|
|
|
|
i am using contextmenustrip in my pgm , i am not able to get the custom popup at the place user clicks , it is showing at different x,y positions And when i rt clicks on textbox it is showing the textbox default rtclick popup menu .I want to hide it . i am using like this but of nouse ..
RtClickPropertiesStrip.Show(New Point(ihorizontal, ivertical), ToolStripDropDownDirection.BelowRight) in mouseDown ifit is mouse rt click
or i use pointtoclient(cursor.position) no use ..
waiting for response
DVSRiRAM
|
|
|
|
|
Why are you even using this code?? The menu already pops up where you right-click the form, so long as the form's ContextMenu property is set to the ContextMenuStrip you want it to show.
|
|
|
|
|
I want to display the popup menu for the runtime contol of textbox , but it is showing both the predefined and custom defined menus . Predefined is showing at the mouse click . How to Disable this one and set the Custom defined popup menu for runtime controls . I am getting for Label . etc Only this problem is for combo box and textbox generated at runtime only using contextmenustrip in vs2005
DVSRIRAM
|
|
|
|
|
OK, the answer doesn't change. Your code still has to set the ContextMenu property of the TextBox you create, just like any other property on it like Size and Location. All you have to do is assign it the menu object you created.
|
|
|
|
|
Thanks Its Working ....
DVSRIRAM
|
|
|
|
|
Hi ,
How i can cut ,copy ,paste a runtime control . I Searched the net but not get the desired results .For example (It is the functionality of VS2005)
ctrl.Visible = True I used CTRL as a object type which i used for creation of controls .
I wish Your Help is Required ....
DVSRIRAM
|
|
|
|
|